/* ============================================================
 * fish-tank-calc.css —— 鱼缸水量计算器专属「蓝海水族」风格
 * 海蓝 + 珊瑚橙配色，胶囊圆角 + 鱼缸水波示意；亮色 / 黑夜双主题
 * 独立于 arc.css / contraction-timer.css / usable-area-rate.css
 * ============================================================ */

:root {
    --ft-bg: #e9f5fa;
    --ft-card: #ffffff;
    --ft-ink: #0d2f42;
    --ft-ink-2: #5d7f92;
    --ft-line: #cde5f0;
    --ft-blue: #1273b8;
    --ft-blue-deep: #0b5590;
    --ft-blue-soft: #d9eefb;
    --ft-water: #4db3e6;
    --ft-coral: #ff7e5f;
    --ft-coral-deep: #e85f40;
    --ft-coral-soft: #ffe9e2;
    --ft-ok: #0e9e6d;
    --ft-ok-soft: #dcf3ea;
    --ft-warn: #c07f10;
    --ft-warn-soft: #fdf0d3;
    --ft-bad: #d24b38;
    --ft-bad-soft: #fbe3de;
    --ft-shadow: 0 12px 30px rgba(18, 115, 184, .10);
    --arc-danger: #d24b38; /* bindAi 错误文案用 */
}

:root[data-theme="dark"] {
    --ft-bg: #0c1a24;
    --ft-card: #122635;
    --ft-ink: #d9ecf6;
    --ft-ink-2: #8aa9bb;
    --ft-line: #23404f;
    --ft-blue: #4ab0e8;
    --ft-blue-deep: #2f95cf;
    --ft-blue-soft: #18384c;
    --ft-water: #2f86bd;
    --ft-coral: #ff9d85;
    --ft-coral-deep: #ff8a6d;
    --ft-coral-soft: #402722;
    --ft-ok: #3fd6a0;
    --ft-ok-soft: #14382c;
    --ft-warn: #eebc55;
    --ft-warn-soft: #3d3115;
    --ft-bad: #ff8a76;
    --ft-bad-soft: #40201b;
    --ft-shadow: 0 12px 30px rgba(0, 0, 0, .45);
    --arc-danger: #ff8a76;
}

/* ---------------- 容器 ---------------- */
.ft {
    background: var(--ft-bg);
    border-radius: 26px;
    padding: 26px 26px 34px;
    color: var(--ft-ink);
    font-size: 15px;
    line-height: 1.75;
    transition: background .25s, color .25s;
}
.ft b { color: var(--ft-ink); }

/* ---------------- 面包屑 ---------------- */
.ft-crumb { font-size: 13px; color: var(--ft-ink-2); margin-bottom: 18px; }
.ft-crumb a { color: var(--ft-ink-2); text-decoration: none; }
.ft-crumb a:hover { color: var(--ft-blue); }
.ft-crumb .sep { margin: 0 7px; opacity: .5; }

/* ---------------- Hero ---------------- */
.ft-hero { position: relative; margin-bottom: 20px; }
.ft-theme {
    position: absolute; top: 0; right: 0;
    border: 1.5px solid var(--ft-line); background: var(--ft-card); color: var(--ft-ink-2);
    border-radius: 999px; padding: 7px 16px; font-size: 12px; font-weight: 700;
    letter-spacing: .08em; cursor: pointer; transition: .2s;
}
.ft-theme:hover { border-color: var(--ft-blue); color: var(--ft-blue); }
.ft-hero-badge {
    width: 66px; height: 66px; border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, var(--ft-water) 0%, var(--ft-blue) 58%, var(--ft-blue-deep) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; box-shadow: var(--ft-shadow); margin-bottom: 16px;
}
.ft-hero h1 { margin: 0 0 4px; font-size: 29px; font-weight: 800; }
.ft-hero h1 .reg {
    display: inline-block; margin-left: 12px; vertical-align: middle;
    font-size: 12px; font-weight: 700; color: var(--ft-coral-deep);
    background: var(--ft-coral-soft); border-radius: 999px; padding: 5px 14px;
    letter-spacing: .06em;
}
.ft-hero p { margin: 10px 0 14px; color: var(--ft-ink-2); max-width: 780px; }
.ft-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-tag {
    font-size: 12px; font-weight: 700; color: var(--ft-ink-2);
    background: var(--ft-card); border: 1.5px solid var(--ft-line);
    border-radius: 999px; padding: 4px 14px;
}

/* ---------------- 卡片 ---------------- */
.ft-card {
    background: var(--ft-card); border: 1.5px solid var(--ft-line);
    border-radius: 22px; padding: 22px;
    margin-top: 18px; box-shadow: var(--ft-shadow);
}
.ft-card-title {
    margin: 0 0 16px; font-size: 17px; font-weight: 800;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.ft-card-title .fi {
    width: 34px; height: 34px; border-radius: 50%; background: var(--ft-blue-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.ft-card-title .sub { font-size: 12.5px; font-weight: 600; color: var(--ft-ink-2); }
.ft-card-title .no {
    margin-left: auto; font-size: 11px; font-weight: 800; color: var(--ft-ink-2);
    letter-spacing: .14em;
}

/* ---------------- 表单 ---------------- */
.ft-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.ft-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.ft-field { margin-bottom: 16px; min-width: 0; }
.ft-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.ft-label .hint { display: block; font-size: 12px; font-weight: 500; color: var(--ft-ink-2); margin-top: 2px; }
.ft-input {
    width: 100%; box-sizing: border-box;
    border: 1.5px solid var(--ft-line); border-radius: 999px;
    background: var(--ft-bg); color: var(--ft-ink);
    padding: 11px 16px; font-size: 15px; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.ft-input:focus { outline: none; border-color: var(--ft-blue); }
.ft-addon { position: relative; display: flex; align-items: stretch; }
.ft-addon .ft-input { flex: 1; border-radius: 999px 0 0 999px; border-right: none; }
.ft-addon .suf {
    display: flex; align-items: center; padding: 0 16px;
    border: 1.5px solid var(--ft-line); border-radius: 0 999px 999px 0;
    background: var(--ft-blue-soft); color: var(--ft-blue-deep);
    font-size: 13px; font-weight: 800; white-space: nowrap;
}
:root[data-theme="dark"] .ft-addon .suf { color: var(--ft-blue); }
.ft-seg { display: inline-flex; flex-wrap: wrap; gap: 7px; }
.ft-seg button {
    border: 1.5px solid var(--ft-line); background: var(--ft-bg);
    color: var(--ft-ink-2); border-radius: 999px; padding: 9px 18px;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: .15s;
}
.ft-seg button:hover { border-color: var(--ft-blue); color: var(--ft-blue); }
.ft-seg button.active {
    background: var(--ft-blue); border-color: var(--ft-blue); color: #fff;
}
.ft-custom { margin-top: 10px; max-width: 260px; }
.ft-status {
    display: none; margin-top: 4px; padding: 11px 16px; border-radius: 999px;
    background: var(--ft-warn-soft); color: var(--ft-warn);
    font-size: 13px; font-weight: 700; width: fit-content;
}
.ft-divider {
    border: none; border-top: 1.5px dashed var(--ft-line);
    margin: 18px 0 16px;
}

/* ---------------- KPI ---------------- */
.ft-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ft-kpi {
    position: relative; overflow: hidden;
    background: var(--ft-bg); border: 1.5px solid var(--ft-line);
    border-radius: 18px; padding: 16px 15px 14px;
}
.ft-kpi::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, var(--ft-water), var(--ft-blue));
}
.ft-kpi .k { font-size: 12px; font-weight: 700; color: var(--ft-ink-2); letter-spacing: .05em; }
.ft-kpi .v { font-size: 21px; font-weight: 800; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.ft-kpi .n { font-size: 11.5px; color: var(--ft-ink-2); line-height: 1.5; }
.ft-kpi.is-big {
    background: linear-gradient(150deg, var(--ft-water) 0%, var(--ft-blue) 55%, var(--ft-blue-deep) 100%);
    border-color: transparent;
}
.ft-kpi.is-big::before { background: rgba(255, 255, 255, .35); }
.ft-kpi.is-big .k, .ft-kpi.is-big .n { color: rgba(255, 255, 255, .85); }
.ft-kpi.is-big .v { color: #fff; font-size: 30px; }

/* ---------------- 鱼缸示意 ---------------- */
.ft-tank-wrap { margin-top: 20px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ft-tank {
    position: relative; width: 240px; height: 170px; flex: none;
    border: 3px solid var(--ft-line); border-top-width: 5px;
    border-radius: 6px 6px 14px 14px;
    background: var(--ft-card);
    overflow: hidden;
}
.ft-water {
    position: absolute; left: 0; right: 0; bottom: 0;
    background: linear-gradient(180deg, var(--ft-water) 0%, var(--ft-blue) 100%);
    opacity: .88; transition: height .5s;
}
.ft-water::before {
    content: ''; position: absolute; top: -9px; left: 0; width: 200%; height: 10px;
    background: radial-gradient(circle at 12px -3px, transparent 11px, var(--ft-water) 12px);
    background-size: 26px 10px; background-repeat: repeat-x;
    animation: ftWave 3.2s linear infinite;
}
@keyframes ftWave { to { transform: translateX(-26px); } }
.ft-bubble {
    position: absolute; bottom: 8px; border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    animation: ftRise 3.6s ease-in infinite;
}
.ft-bubble.b1 { left: 22%; width: 8px; height: 8px; animation-delay: 0s; }
.ft-bubble.b2 { left: 34%; width: 5px; height: 5px; animation-delay: 1.1s; }
.ft-bubble.b3 { left: 27%; width: 6px; height: 6px; animation-delay: 2.2s; }
@keyframes ftRise {
    0% { transform: translateY(0); opacity: 0; }
    15% { opacity: .9; }
    100% { transform: translateY(-130px); opacity: 0; }
}
.ft-tank-info { flex: 1; min-width: 220px; }
.ft-tank-info .dim-line { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ft-tank-info .fill-line { font-size: 12.5px; color: var(--ft-ink-2); margin-top: 4px; }

/* ---------------- 下盐 / 用药 ---------------- */
.ft-dose-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.ft-dose {
    border: 1.5px solid var(--ft-line); border-radius: 18px;
    background: var(--ft-bg); padding: 16px 18px;
}
.ft-dose .dh {
    display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
    font-size: 14.5px; font-weight: 800; margin-bottom: 10px;
}
.ft-dose .dh .di {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--ft-blue-soft);
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.ft-dose .dh .dc {
    margin-left: auto; font-size: 12px; font-weight: 800; color: var(--ft-blue);
    background: var(--ft-blue-soft); border-radius: 999px; padding: 3px 12px;
}
.ft-dose .drow {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 8px 0; border-top: 1.5px dashed var(--ft-line);
    font-size: 13.5px;
}
.ft-dose .drow b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ft-dose .drow small { color: var(--ft-ink-2); font-size: 11.5px; }
.ft-dose .dtip { margin-top: 10px; font-size: 12.5px; color: var(--ft-ink-2); line-height: 1.7; }
.ft-dose .dempty { font-size: 13px; color: var(--ft-ink-2); padding: 6px 0 2px; }
.ft-dose.ok { border-color: var(--ft-ok); }
.ft-dose.ok .dtip b { color: var(--ft-ok); }
.ft-dose.warn { border-color: var(--ft-warn); }
.ft-dose.warn .dtip b { color: var(--ft-warn); }
.ft-dose.bad { border-color: var(--ft-bad); }
.ft-dose.bad .dtip b { color: var(--ft-bad); }
.ft-dose.med .dh .di { background: var(--ft-coral-soft); }
.ft-dose.med .dh .dc { color: var(--ft-coral-deep); background: var(--ft-coral-soft); }
:root[data-theme="dark"] .ft-dose.med .dh .dc { color: var(--ft-coral); }
.ft-dose.med .drow b { color: var(--ft-coral-deep); }
:root[data-theme="dark"] .ft-dose.med .drow b { color: var(--ft-coral); }

/* ---------------- 明细表 ---------------- */
.ft-table { margin-top: 18px; border: 1.5px solid var(--ft-line); border-radius: 18px; overflow: hidden; }
.ft-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ft-table th, .ft-table td { padding: 11px 15px; text-align: left; border-bottom: 1.5px solid var(--ft-line); }
.ft-table th { background: var(--ft-bg); font-size: 12px; letter-spacing: .06em; color: var(--ft-ink-2); }
.ft-table tr:last-child td { border-bottom: none; }
.ft-table td.num { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ft-table td.dim { color: var(--ft-ink-2); font-size: 12.5px; }

/* ---------------- 备注条 ---------------- */
.ft-note {
    margin-top: 16px; display: flex; gap: 10px; align-items: flex-start;
    font-size: 13px; color: var(--ft-ink-2); line-height: 1.75;
    background: var(--ft-bg); border: 1.5px dashed var(--ft-line);
    border-radius: 18px; padding: 13px 16px;
}
.ft-note .ni { flex: none; font-size: 15px; }

/* ---------------- AI ---------------- */
.ft-textarea {
    width: 100%; box-sizing: border-box; resize: vertical;
    border: 1.5px solid var(--ft-line); border-radius: 18px;
    background: var(--ft-bg); color: var(--ft-ink);
    padding: 12px 16px; font-size: 14px; font-family: inherit; line-height: 1.6;
}
.ft-textarea:focus { outline: none; border-color: var(--ft-blue); }
.ft-btn {
    border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--ft-water) 0%, var(--ft-blue-deep) 100%);
    color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .04em;
    border-radius: 999px; padding: 12px 30px; margin-top: 14px;
    box-shadow: 0 10px 22px rgba(18, 115, 184, .30); transition: .15s;
}
.ft-btn:hover { transform: translateY(-2px); }
.ft-btn:disabled { opacity: .6; cursor: default; transform: none; }
.ft-ai {
    margin-top: 16px; border-radius: 18px; padding: 16px 18px;
    background: var(--ft-bg); border: 1.5px solid var(--ft-line);
    font-size: 14px; line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
.ft-ai.empty { color: var(--ft-ink-2); }
.arc-dots::after { content: ''; animation: ftDots 1.2s steps(4) infinite; }
@keyframes ftDots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* ---------------- toast（Arc.toast 用） ---------------- */
.arc-toast {
    position: fixed; left: 50%; bottom: 36px;
    transform: translateX(-50%) translateY(16px);
    background: var(--ft-ink, #0d2f42); color: var(--ft-card, #fff);
    padding: 11px 22px; border-radius: 999px;
    font-size: 13.5px; font-weight: 600; z-index: 9999;
    opacity: 0; pointer-events: none; transition: .25s;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}
.arc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- Tabs / Panels（胶囊式） ---------------- */
.ft-tabs {
    display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 26px;
    background: var(--ft-card); border: 1.5px solid var(--ft-line);
    border-radius: 999px; padding: 5px;
}
.ft-tab {
    border: none; background: transparent; border-radius: 999px;
    color: var(--ft-ink-2); padding: 9px 20px;
    font-size: 13.5px; font-weight: 700; cursor: pointer; transition: .15s;
}
.ft-tab:hover { color: var(--ft-blue); }
.ft-tab.active {
    background: linear-gradient(135deg, var(--ft-water) 0%, var(--ft-blue-deep) 100%);
    color: #fff;
}
.ft-panel { display: none; padding: 20px 6px 4px; }
.ft-panel.active { display: block; }
.ft-panel h2 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }
.ft-panel h2:first-child { margin-top: 4px; }
.ft-panel p { margin: 8px 0; }
.ft-panel ul { margin: 8px 0; padding-left: 22px; }
.ft-panel li { margin: 6px 0; }
.ft-faq details {
    border: 1.5px solid var(--ft-line); border-radius: 18px;
    background: var(--ft-card); margin: 10px 0; overflow: hidden;
}
.ft-faq summary {
    cursor: pointer; padding: 13px 18px; font-weight: 700; font-size: 14px;
    list-style: none;
}
.ft-faq summary::-webkit-details-marker { display: none; }
.ft-faq summary::before { content: '▸'; color: var(--ft-blue); margin-right: 9px; }
.ft-faq details[open] summary::before { content: '▾'; }
.ft-faq .a { padding: 0 18px 15px; font-size: 13.5px; color: var(--ft-ink-2); line-height: 1.8; }
.ft-timeline { list-style: none; padding: 0 !important; }
.ft-timeline li {
    display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap;
    padding: 10px 0; border-bottom: 1.5px dashed var(--ft-line);
}
.ft-timeline .ver {
    font-size: 11.5px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--ft-water), var(--ft-blue-deep));
    border-radius: 999px; padding: 3px 12px;
}
.ft-timeline .date { font-size: 12.5px; color: var(--ft-ink-2); font-weight: 700; }
.ft-timeline .txt { flex: 1 1 100%; font-size: 13.5px; }

/* ---------------- 相关工具 ---------------- */
.ft-rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ft-rel {
    display: flex; gap: 11px; align-items: center; text-decoration: none;
    border: 1.5px solid var(--ft-line); border-radius: 18px;
    background: var(--ft-bg); padding: 13px 14px; transition: .15s;
}
.ft-rel:hover { border-color: var(--ft-blue); transform: translateY(-2px); }
.ft-rel .ri {
    width: 40px; height: 40px; border-radius: 50%; background: var(--ft-blue-soft);
    display: flex; align-items: center; justify-content: center; font-size: 19px; flex: none;
}
.ft-rel b { display: block; font-size: 13.5px; color: var(--ft-ink); }
.ft-rel small { font-size: 11.5px; color: var(--ft-ink-2); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
    .ft-kpis { grid-template-columns: repeat(2, 1fr); }
    .ft-rel-grid { grid-template-columns: repeat(2, 1fr); }
    .ft-dose-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .ft { padding: 18px 14px 26px; border-radius: 18px; }
    .ft-hero h1 { font-size: 22px; }
    .ft-hero h1 .reg { display: block; margin: 8px 0 0; width: fit-content; }
    .ft-grid2, .ft-grid3 { grid-template-columns: 1fr; }
    .ft-rel-grid { grid-template-columns: 1fr; }
    .ft-theme { position: static; margin-bottom: 12px; }
    .ft-tabs { display: flex; border-radius: 22px; }
    .ft-tab { flex: 1 1 40%; }
    .ft-tank { width: 100%; }
    .ft-table td.dim { display: none; }
}
