/* ==========================================================================
   电气二次设计工作台 · 现代科技界面设计规范
   设计参考：sentools.sen666.com (Clean Tech & Slate Modern Aesthetic)
   ========================================================================== */

/* 全局重置与盒子模型 */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 颜色变量体系 (Light / Dark) */
:root {
    --bg: #f8fafc;
    --bg-alt: #ffffff;
    --bg-subtle: #f1f5f9;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-hover: #cbd5e1;

    --card-bg-1: #ffffff;
    --card-bg-2: #fafcff;
    --card-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --card-shadow-hover: 0 20px 35px -8px rgba(15, 23, 42, 0.09), 0 12px 16px -8px rgba(15, 23, 42, 0.05);

    --nav-bg: rgba(255, 255, 255, 0.88);

    /* 侧边栏 Aside 亮色模式：纯净现代白 */
    --aside-bg: #ffffff;
    --aside-border: #e2e8f0;
    --aside-text: #0f172a;
    --aside-text-secondary: #475569;
    --aside-text-muted: #94a3b8;
    --aside-item-hover: #f1f5f9;
    --aside-active-bg: rgba(37, 99, 235, 0.08);
    --aside-active-border: rgba(37, 99, 235, 0.2);
    --aside-active-text: #2563eb;
    --aside-badge-bg: #f1f5f9;
    --aside-badge-text: #64748b;
    --aside-active-badge-bg: #2563eb;
    --aside-active-badge-text: #ffffff;

    /* Hero Banner 亮色模式：清爽微蓝渐变，告别黑块 */
    --hero-bg: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #f0fdf4 100%);
    --hero-border: #bfdbfe;
    --hero-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.03);
    --hero-title: #0f172a;
    --hero-eyebrow: #2563eb;
    --hero-desc: #475569;
    --hero-icon: rgba(37, 99, 235, 0.07);

    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-active: #1e40af;
    --accent-soft: rgba(37, 99, 235, 0.12);
    --accent-soft-hover: rgba(37, 99, 235, 0.18);
    --accent-glow: rgba(37, 99, 235, 0.25);

    --badge-bg: #0f172a;
    --badge-color: #ffffff;

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --success-border: rgba(16, 185, 129, 0.28);

    --warn: #f59e0b;
    --warn-soft: rgba(245, 158, 11, 0.12);
    --warn-border: rgba(245, 158, 11, 0.28);

    --error: #ef4444;
    --error-soft: rgba(239, 68, 68, 0.12);
    --error-border: rgba(239, 68, 68, 0.28);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* 深色模式变量映射 (对齐 sentools dark) */
html.dark {
    --bg: #090d16;
    --bg-alt: #0f172a;
    --bg-subtle: #141e33;
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #1e293b;
    --border-light: #162032;
    --border-hover: #334155;

    --card-bg-1: #0f172a;
    --card-bg-2: #111a30;
    --card-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
    --card-shadow-hover: 0 22px 45px rgba(0, 0, 0, 0.55);

    --nav-bg: rgba(9, 13, 22, 0.85);

    /* 侧边栏 Aside 深色模式：深空蓝黑 */
    --aside-bg: #070b14;
    --aside-border: #182235;
    --aside-text: #f8fafc;
    --aside-text-secondary: #94a3b8;
    --aside-text-muted: #64748b;
    --aside-item-hover: rgba(255, 255, 255, 0.05);
    --aside-active-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.12));
    --aside-active-border: rgba(59, 130, 246, 0.35);
    --aside-active-text: #60a5fa;
    --aside-badge-bg: rgba(255, 255, 255, 0.05);
    --aside-badge-text: #64748b;
    --aside-active-badge-bg: rgba(59, 130, 246, 0.3);
    --aside-active-badge-text: #93c5fd;

    /* Hero Banner 深色模式：优雅暗夜深蓝 */
    --hero-bg: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --hero-border: #334155;
    --hero-shadow: var(--card-shadow);
    --hero-title: #f8fafc;
    --hero-eyebrow: #93c5fd;
    --hero-desc: #cbd5e1;
    --hero-icon: rgba(255, 255, 255, 0.04);

    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-active: #2563eb;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --accent-soft-hover: rgba(59, 130, 246, 0.24);
    --accent-glow: rgba(59, 130, 246, 0.35);

    --badge-bg: #3b82f6;
    --badge-color: #ffffff;

    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.15);
    --success-border: rgba(52, 211, 153, 0.3);

    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.15);
    --warn-border: rgba(251, 191, 36, 0.3);

    --error: #f87171;
    --error-soft: rgba(248, 113, 113, 0.15);
    --error-border: rgba(248, 113, 113, 0.3);
}

/* 基础排版与滚动条 */
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

h1, h2, h3, h4, p {
    margin-top: 0;
}
h1 {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
}
h2 {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}
h3 {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.18s ease;
}
a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: inline-block;
}

.muted {
    color: var(--text-secondary);
}

/* 品牌微章 (⚡ / Ⅱ) */
.mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent), #1d4ed8);
    color: #ffffff;
    font-family: var(--font-sans);
    font-weight: 800;
    font-size: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--accent-glow);
    user-select: none;
}

/* ==========================================================================
   通用交互组件：按钮、输入框、选择器
   ========================================================================== */
button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

button, .button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 18px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    user-select: none;
}

button:hover, .button:hover {
    border-color: var(--border-hover);
    background: var(--bg-subtle);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

button:active, .button:active {
    transform: translateY(0);
}

button:disabled, .button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* 主行动按钮 (Primary / sentools 风格) */
.primary, button.primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.primary:hover, button.primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
    color: #ffffff;
    box-shadow: 0 6px 18px var(--accent-glow);
    transform: translateY(-1px);
}

/* 输入控件 */
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 9px 14px;
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.5;
    transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: var(--bg-alt);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ==========================================================================
   登录页面 (Login) · 现代磨砂玻璃居中卡片
   ========================================================================== */
.login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

/* 背景科技微光动效 */
.login::before {
    content: "";
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    opacity: 0.8;
}

.login form {
    width: min(440px, 92vw);
    padding: 44px 38px;
    background: var(--card-bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow-hover);
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
    transition: all 0.3s ease;
}

.login .mark {
    margin-bottom: 20px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 1.5rem;
}

.login h1 {
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.login p.muted {
    font-size: 0.95rem;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.login label {
    margin: 8px 0 20px;
}

.login input[type="password"] {
    height: 44px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.login button {
    height: 44px;
    font-size: 0.95rem;
    width: 100%;
    border-radius: var(--radius-md);
}

#login-error {
    color: var(--error);
    background: var(--error-soft);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 14px;
    display: none;
}
#login-error:not(:empty) {
    display: block;
}

/* ==========================================================================
   工作区主体框架 (Workspace)
   ========================================================================== */
#workspace {
    display: flex;
    min-height: 100vh;
}
#workspace[hidden], .login[hidden] {
    display: none !important;
}

/* 侧边栏 Aside (亮色与暗色自适应) */
aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    background: var(--aside-bg);
    border-right: 1px solid var(--aside-border);
    color: var(--aside-text);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--aside-text);
    letter-spacing: -0.02em;
    padding: 0 4px;
}

.brand .mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1.1rem;
}

.brand small {
    display: block;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
    color: var(--aside-text-muted);
    margin-top: 2px;
    font-weight: 600;
}

/* 工程选择器 */
.project-picker {
    margin: 24px 0 20px;
    padding: 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.project-picker label {
    color: var(--aside-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.project-picker select {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    font-size: 0.86rem;
    margin-top: 6px;
}

.project-picker select:focus {
    border-color: var(--accent);
}

.project-picker button {
    width: 100%;
    background: var(--bg-alt);
    color: var(--aside-text-secondary);
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    height: 32px;
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: none;
}

.project-picker button:hover {
    background: var(--bg-subtle);
    border-color: var(--accent);
    color: var(--accent);
}

/* 导航项 Navigation */
nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

nav button {
    text-align: left;
    justify-content: flex-start;
    background: transparent;
    border: 1px solid transparent;
    color: var(--aside-text-secondary);
    padding: 10px 14px;
    height: auto;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: all 0.18s ease;
}

nav button span {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    margin-right: 12px;
    color: var(--aside-badge-text);
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--aside-badge-bg);
    transition: all 0.18s ease;
}

nav button:hover {
    background: var(--aside-item-hover);
    color: var(--aside-text);
    transform: translateX(2px);
    box-shadow: none;
}

nav button.active {
    background: var(--aside-active-bg);
    border-color: var(--aside-active-border);
    color: var(--aside-active-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

nav button.active span {
    background: var(--aside-active-badge-bg);
    color: var(--aside-active-badge-text);
}

/* 边栏底部 */
.aside-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--aside-border);
    font-size: 0.74rem;
    color: var(--aside-text-muted);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 8px var(--success);
}

.aside-footer button {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    padding: 6px 0;
    height: auto;
    color: var(--aside-text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: none;
}

.aside-footer button:hover {
    color: var(--error);
    background: transparent;
    transform: none;
}

/* 主内容区域 Main */
main {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 32px 48px;
    max-width: 1560px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部粘性栏 Header */
header {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -32px -48px 30px -48px;
    padding: 16px 48px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

header .header-left {
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: 1.5rem;
    line-height: 1.2;
    margin-bottom: 0;
}

header .header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 主题切换按钮 Theme Toggle (sentools 风格) */
.theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--bg-alt);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.theme-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-subtle);
    transform: translateY(-1px);
}

.theme-icon {
    font-size: 0.94rem;
    line-height: 1;
}

/* 在线状态徽章 */
.nav-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}
.nav-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

/* 内容板块 */
section {
    min-height: 70vh;
    flex: 1;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 24px 0 0;
    margin-top: 40px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* ==========================================================================
   页面视图组件：Hero、Stats、Panels、Tables
   ========================================================================== */

/* Hero Banner (浅色清新透亮，深色沉稳高阶) */
.hero {
    background: var(--hero-bg);
    color: var(--hero-title);
    padding: 34px 38px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    margin-bottom: 26px;
    box-shadow: var(--hero-shadow);
    border: 1px solid var(--hero-border);
    transition: all 0.25s ease;
}

.hero::after {
    content: '⚡';
    position: absolute;
    right: 28px;
    top: -24px;
    font-size: 140px;
    color: var(--hero-icon);
    pointer-events: none;
    user-select: none;
}

.hero .eyebrow {
    color: var(--hero-eyebrow);
    font-weight: 700;
}

.hero h2 {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--hero-title);
}

.hero p {
    color: var(--hero-desc);
    max-width: 680px;
    line-height: 1.65;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* 统计卡片网格 (Stats / Tiles - sentools 风格) */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 26px;
}

.stat {
    background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
    border: 1px solid var(--border);
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
}

.stat span {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.95rem;
    font-weight: 800;
    color: var(--text);
    margin-top: 10px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

/* 面板 (Panel) */
.panel {
    background: linear-gradient(180deg, var(--card-bg-1), var(--card-bg-2));
    border: 1px solid var(--border);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel h3 {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel .grid {
    gap: 18px;
}

/* 操作按钮行 */
.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* 文件上传拖拽区 (Drop) */
.drop {
    border: 2px dashed var(--border);
    padding: 30px;
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    margin: 20px 0;
    text-align: center;
    transition: all 0.2s ease;
}

.drop:hover,
.drop.drag-over {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.drop h3 {
    justify-content: center;
    margin-bottom: 8px;
}

.drop input[type="file"] {
    max-width: 380px;
    width: 100%;
    box-sizing: border-box;
    margin: 16px auto;
    display: block;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    cursor: pointer;
}

/* 表格容器 (Table Wrap) */
.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-alt);
    margin: 16px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

thead {
    background: var(--bg-subtle);
}

th {
    padding: 12px 16px;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    vertical-align: middle;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--bg-subtle);
}

td input, td select {
    min-width: 130px;
    padding: 6px 10px;
    font-size: 0.86rem;
    border-radius: var(--radius-sm);
}

/* 状态药丸 (Badges) */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    background: var(--success-soft);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: var(--warn-border);
}

.badge.error {
    background: var(--error-soft);
    color: var(--error);
    border-color: var(--error-border);
}

/* 代码与文本编辑区 (Textarea & Pre) */
textarea {
    min-height: 330px;
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-alt);
}

.editor-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 16px 0 8px;
}

.editor-label strong {
    font-size: 0.9rem;
    color: var(--text);
}

.editor-label span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.terminal-toolbar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

pre {
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    line-height: 1.7;
    background: var(--bg-subtle);
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
}

/* 步骤指南 (Steps) */
.steps {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0;
}

.steps p {
    padding: 12px 16px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    margin-bottom: 0;
    transition: all 0.18s ease;
}

.steps p:hover {
    border-color: var(--border-hover);
    background: var(--bg-alt);
    transform: translateX(2px);
}

.steps p::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 700;
    margin-right: 14px;
    padding: 2px 8px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}

/* 结果盒子与问题指示 (Results) */
.results {
    border-left: 3px solid var(--accent);
    background: var(--accent-soft);
    padding: 18px 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 20px 0;
}

.results h3 {
    color: var(--accent);
    margin-bottom: 8px;
}

.results p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.search {
    max-width: 380px;
    margin-bottom: 16px;
}

/* 空白占位 (Empty State) */
.empty {
    padding: 80px 24px;
    text-align: center;
    border: 2px dashed var(--border);
    background: var(--card-bg-1);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    margin: 20px 0;
}

.empty .mark {
    width: 64px;
    height: 64px;
    font-size: 2rem;
    margin-bottom: 18px;
    border-radius: 18px;
}

.empty h2 {
    margin: 12px 0 8px;
}

/* 消息提示框 (Toast - 居中悬浮胶囊浮岛) */
#toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--bg-alt);
    color: var(--success);
    border: 1px solid var(--success-border);
    padding: 10px 22px;
    border-radius: var(--radius-full);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.12);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    pointer-events: none;
    animation: toastPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    width: max-content;
    max-width: min(540px, 90vw);
}

#toast[hidden] {
    display: none !important;
}

#toast::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success-soft);
    font-size: 0.75rem;
}

#toast.error {
    color: var(--error);
    border-color: var(--error-border);
}

#toast.error::before {
    content: "✕";
    background: var(--error-soft);
}

@keyframes toastPop {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* 对话框模态层 (Dialog) */
dialog {
    border: 1px solid var(--border);
    background: var(--card-bg-1);
    color: var(--text);
    padding: 34px;
    min-width: min(460px, 92vw);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow-hover);
    margin: auto;
}

dialog::backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
}

dialog h2 {
    margin: 6px 0 20px;
}

dialog label {
    margin-bottom: 24px;
}

dialog .actions {
    justify-content: flex-end;
    margin: 0;
}

/* 转圈加载 (Busy Indicator) */
.busy {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   响应式断点适配 (Responsive Layouts)
   ========================================================================== */
@media (max-width: 1080px) {
    main {
        padding: 24px 28px;
    }
    header {
        margin: -24px -28px 24px -28px;
        padding: 14px 28px;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    aside {
        position: static;
        width: 100%;
        padding: 18px;
    }
    #workspace {
        display: block;
    }
    main {
        margin-left: 0;
        width: 100%;
        padding: 20px 16px;
    }
    header {
        margin: -20px -16px 20px -16px;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    header .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    nav button {
        padding: 8px 10px;
        font-size: 0.82rem;
    }
    .aside-footer {
        display: none;
    }
    .hero {
        padding: 22px;
    }
    .stat {
        padding: 16px;
    }
    .panel {
        padding: 20px 16px;
    }
    .terminal-toolbar {
        grid-template-columns: 1fr;
    }
}

.drop.drag-over { box-shadow: 0 0 0 4px var(--accent-soft); }
.drop-hint { margin-top: 12px; color: var(--accent); }
.upload-list { list-style: none; padding: 0; margin: 12px auto 20px; max-width: 640px; text-align: left; }
.upload-list li { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.upload-list span { min-width: 0; overflow-wrap: anywhere; }
.upload-list small { color: var(--text-muted); }
.upload-list button { flex-shrink: 0; padding: 6px 12px; }
