/* 基础样式重置 */
* {margin:0;padding:0;box-sizing:border-box;}
body {
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
    line-height:1.5;
    color:#0f172a;
    background:
        radial-gradient(1200px 600px at 20% 0%, rgba(59,130,246,.15), rgba(59,130,246,0) 60%),
        radial-gradient(1200px 600px at 80% 0%, rgba(34,197,94,.12), rgba(34,197,94,0) 60%),
        #f6f8fc;
}

/* 容器样式 */
.container {width:100%;max-width:1140px;margin:0 auto;padding:0 15px;}
.index-container {margin-top:50px;}
.tool-container {margin-top:30px;}

/* 卡片样式 */
.card {
    position:relative;
    display:flex;
    flex-direction:column;
    min-width:0;
    word-wrap:break-word;
    background:rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border:1px solid rgba(15,23,42,.08);
    border-radius:16px;
    margin:20px 0;
    box-shadow:0 10px 30px rgba(15,23,42,.08);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {transform:translateY(-4px);box-shadow:0 18px 50px rgba(15,23,42,.12);border-color: rgba(59,130,246,.25);}
.card-body {flex:1 1 auto;padding:1.25rem;}
.card-body.text-center {text-align:center;}
.card-title {font-size:1.125rem;font-weight:700;color:#0f172a;margin-bottom:.5rem;letter-spacing:.2px;}
.card-text {color:#475569;}

/* 按钮样式 */
.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:.35rem;
    font-weight:600;
    color:#0f172a;
    text-align:center;
    vertical-align:middle;
    user-select:none;
    background-color:transparent;
    border:1px solid transparent;
    padding:.55rem .95rem;
    font-size:1rem;
    line-height:1.2;
    border-radius:12px;
    transition:transform .12s ease, color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    text-decoration:none;
    cursor:pointer;
    box-shadow:0 2px 0 rgba(15,23,42,.04);
}
.btn:hover {transform:translateY(-1px);}
.btn:active {transform:translateY(0);}
.btn:focus {outline:0;box-shadow:0 0 0 .25rem rgba(59,130,246,.2);}
.btn-primary {color:#fff;background:linear-gradient(135deg,#2563eb,#1d4ed8);border-color:rgba(29,78,216,.8);}
.btn-primary:hover {color:#fff;background:linear-gradient(135deg,#1d4ed8,#1e40af);border-color:rgba(30,64,175,.9);}
.btn-secondary {color:#0f172a;background-color:#fff;border-color:rgba(15,23,42,.14);}
.btn-secondary:hover {color:#0f172a;background-color:#f8fafc;border-color:rgba(59,130,246,.28);}
.btn-danger {color:#fff;background:linear-gradient(135deg,#ef4444,#dc2626);border-color:rgba(220,38,38,.85);}
.btn-danger:hover {color:#fff;background:linear-gradient(135deg,#dc2626,#b91c1c);border-color:rgba(185,28,28,.9);}
.btn-success {color:#fff;background:linear-gradient(135deg,#22c55e,#16a34a);border-color:rgba(22,163,74,.85);}
.btn-success:hover {color:#fff;background:linear-gradient(135deg,#16a34a,#15803d);border-color:rgba(21,128,61,.9);}
.btn-sm {padding:.35rem .6rem;font-size:.9rem;border-radius:10px;}
.btn.mt-10 {margin-top:10px;}

/* 表单样式 */
.form-group {margin-bottom:1rem;}
.form-control {
    display:block;
    width:100%;
    height:calc(1.5em + .9rem + 2px);
    padding:.45rem .75rem;
    font-size:1rem;
    font-weight:500;
    line-height:1.5;
    color:#0f172a;
    background-color:rgba(255,255,255,.92);
    background-clip:padding-box;
    border:1px solid rgba(15,23,42,.14);
    border-radius:12px;
    transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out, background-color .15s ease-in-out;
}
.form-control:focus {color:#0f172a;background-color:#fff;border-color:rgba(59,130,246,.55);outline:0;box-shadow:0 0 0 .25rem rgba(59,130,246,.18);}
label {display:inline-block;margin-bottom:.5rem;}

/* 输入组样式 */
.input-group {position:relative;display:flex;flex-wrap:wrap;align-items:stretch;width:100%;}
.input-group>.form-control {position:relative;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0;}
.input-group>.btn {position:relative;z-index:2;}

/* 进度条样式 */
.progress {display:flex;height:12px;overflow:hidden;font-size:.75rem;background-color:rgba(15,23,42,.08);border-radius:999px;margin-top:20px;}
.progress-bar {display:flex;flex-direction:column;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background:linear-gradient(90deg,#2563eb,#22c55e);transition:width .35s ease;}

/* 自定义样式 */
.config-row {margin-bottom:12px;padding:12px;border:1px solid rgba(15,23,42,.08);border-radius:14px;background:rgba(255,255,255,.7);}
.info-row {margin-bottom:10px;}
.status {margin-top:10px;font-weight:bold;}
.status {color:#0f172a;}
.result h6 {margin-top:.75rem;margin-bottom:.5rem;color:#0f172a;}

/* 分割配置行：更整齐的对齐 */
.config-row .row {align-items:flex-end; row-gap:.75rem;}
.config-row label {margin-bottom:.35rem; font-size:.9rem; color:#334155; font-weight:600;}
.config-row .col-md-1:first-child {display:flex; align-items:center;}
.config-row .col-md-1:first-child label {margin-bottom:0; font-size:.95rem; color:#0f172a;}
.config-row .count-input {text-align:center; font-variant-numeric: tabular-nums;}
.config-row .name-input {font-variant-numeric: tabular-nums;}

/* 分割方式切换 */
.mode-toggle {display:flex; flex-wrap:wrap; align-items:center; gap:.75rem;}
.mode-option {display:inline-flex; align-items:center; gap:.4rem; margin-bottom:0;}
.mode-option input[type="radio"] {transform: translateY(1px);}
.mode-hint {font-size:.9rem;}

/* 网格样式 */
.row {display:flex;flex-wrap:wrap;margin-right:-15px;margin-left:-15px;}
.col-md-2 {flex:0 0 16.666667%;max-width:16.666667%;padding-right:15px;padding-left:15px;}
.col-md-3 {flex:0 0 25%;max-width:25%;padding-right:15px;padding-left:15px;}
.col-md-4 {flex:0 0 33.333333%;max-width:33.333333%;padding-right:15px;padding-left:15px;}
.col-md-5 {flex:0 0 41.666667%;max-width:41.666667%;padding-right:15px;padding-left:15px;}
.col-md-6 {flex:0 0 50%;max-width:50%;padding-right:15px;padding-left:15px;}

/* 文本样式 */
h1 {font-size:2.25rem;font-weight:800;margin-bottom:1rem;letter-spacing:.3px;color:#0f172a;}
h5 {font-size:1.25rem;font-weight:500;margin-bottom:.5rem;}
p {margin-top:0;margin-bottom:1rem;}
.text-center {text-align:center;}
.text-muted {color:#64748b;}
.mb-2 {margin-bottom:.5rem;}
.mb-3 {margin-bottom:1rem;}
.mb-4 {margin-bottom:1.5rem;}
.mb-5 {margin-bottom:3rem;}
.mt-2 {margin-top:.5rem;}
.mt-4 {margin-top:1.5rem;}
.mt-3 {margin-top:1rem;}
.mr-2 {margin-right:.5rem;}

/* 链接 */
a {color:inherit;}
a.btn {text-decoration:none;}

/* 响应式调整 */
@media (max-width:768px) {
    .container {max-width:100%;}
    .col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6 {flex:0 0 100%;max-width:100%;}
    h1 {font-size:1.75rem;}
    .card-body {padding:1rem;}
}