:root {
    color-scheme: light;
    --page: #eef2f6;
    --surface: #fff;
    --surface-soft: #f7f9fb;
    --line: #dce4eb;
    --ink: #17212b;
    --muted: #5a6875;
    --accent: #1168d4;
    --accent-dark: #0755b5;
    --accent-soft: #eaf3ff;
    --shadow: 0 8px 24px rgba(24,43,61,.06);
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
}

*{box-sizing:border-box}
html{background:var(--page);scrollbar-gutter:stable}
body{margin:0;min-height:100vh;color:var(--ink);background:var(--page);font-size:14px;line-height:1.5}
button,textarea{font:inherit}
button{cursor:pointer}
a{color:var(--accent-dark);text-decoration:none}
a:hover{color:var(--accent)}
button,a{touch-action:manipulation;-webkit-tap-highlight-color:rgba(0,113,227,.18)}
button:focus-visible,a:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
button:disabled{cursor:not-allowed;opacity:.5}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link{position:fixed;top:8px;left:8px;z-index:100;padding:8px 12px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:var(--shadow);transform:translateY(-150%)}
.skip-link:focus{transform:translateY(0)}

.app-header{background:var(--surface);border-bottom:1px solid var(--line)}
.app-header-inner,.page-main,.page-footer{width:min(960px,calc(100% - 40px));margin:0 auto}
.app-header-inner{min-height:64px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.app-brand{min-width:0;display:flex;align-items:center;gap:11px;color:inherit}
.brand-mark{width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;color:var(--accent);background:var(--accent-soft);border:1px solid #cfe2fa;border-radius:9px}
.brand-mark svg{width:20px;height:20px}
.brand-copy{min-width:0}
.brand-copy strong{display:block;font-size:18px;line-height:1.2}
.brand-copy p{margin:3px 0 0;color:var(--muted);font-size:12px}

.page-main{display:grid;gap:10px;padding:14px 0 0}
.tool-card,.result-card{background:var(--surface);border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow)}
.input-card{padding:16px}
.section-heading,.result-heading,.result-item-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.section-heading{margin-bottom:12px}
.section-heading h1,.result-heading h2{margin:0;color:var(--ink);font-size:18px;line-height:1.3}
.section-heading p,.result-heading p,.result-item-heading p{margin:3px 0 0;color:var(--muted);font-size:12px}
.help-link{flex:0 0 auto;padding:3px 0;font-size:12px;font-weight:700}

#inputInfo{display:block;width:100%;min-height:132px;resize:vertical;padding:11px 12px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font-size:16px;line-height:1.65}
#inputInfo:hover{border-color:#bdcad5}
#inputInfo:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(17,104,212,.10);outline:none}
.input-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px}
.input-hint{color:var(--muted);font-size:12px}

.secondary-button{min-height:38px;border-radius:8px;padding:0 13px;font-weight:700;white-space:nowrap;border:1px solid var(--line);color:var(--ink);background:var(--surface)}
.secondary-button:hover:not(:disabled){background:var(--surface-soft);border-color:#bdcad5}
.secondary-button:active:not(:disabled){transform:translateY(1px)}
.compact-button{min-height:32px;padding:0 11px;font-size:12px}

.result-card{overflow:hidden}
.result-heading{padding:12px 14px;border-bottom:1px solid var(--line)}
.result-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--line)}
.result-item{min-width:0;padding:13px 14px;background:var(--surface)}
.result-item:last-child{grid-column:1/-1}
.result-item-heading{align-items:center;margin-bottom:8px}
.result-item-heading h3{margin:0;color:var(--ink);font-size:14px;line-height:1.3}
.result-text{min-height:48px;max-height:180px;overflow:auto;padding:10px 11px;border:1px solid var(--line);border-radius:8px;background:var(--surface-soft);color:#334155;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:15px;line-height:1.7;overflow-wrap:anywhere;white-space:pre-wrap}
.empty-text{color:var(--muted);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;font-size:12px}

.toast{position:fixed;top:18px;left:50%;z-index:9999;max-width:calc(100vw - 28px);padding:9px 13px;border-radius:8px;color:#fff;background:#24313d;box-shadow:0 10px 24px rgba(24,43,61,.18);font-size:12px;font-weight:650;text-align:center;opacity:0;pointer-events:none;transform:translate(-50%,-12px);transition:opacity .18s,transform .18s}
.toast.show{opacity:1;transform:translate(-50%,0)}

.page-footer{padding:10px 0 20px;color:var(--muted);text-align:center;font-size:12px}
.page-footer p{margin:0}
.page-footer a{color:inherit}
.page-footer a:hover{color:var(--accent);text-decoration:underline}

@media(max-width:760px){
    .app-header-inner,.page-main,.page-footer{width:min(100% - 28px,680px)}
    .result-list{grid-template-columns:1fr}
    .result-item:last-child{grid-column:auto}
}

@media(max-width:560px){
    .app-header-inner{min-height:60px}
    .brand-copy strong{font-size:16px}
    .brand-copy p{display:none}
    .page-main{padding-top:9px}
    .input-card{padding:14px}
    .section-heading{margin-bottom:10px}
    .section-heading h1,.result-heading h2{font-size:16px}
    #inputInfo{min-height:120px;font-size:16px}
    .input-actions{align-items:flex-start;flex-direction:column}
    .input-actions .secondary-button{width:100%;min-height:42px}
    .result-heading{padding:11px 12px}
    .result-item{padding:12px}
    .result-item-heading{align-items:flex-start}
    .compact-button{min-height:38px}
    .result-text{font-size:14px}
    .toast{top:auto;bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-50%,12px)}
    .toast.show{transform:translate(-50%,0)}
}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
