/* ==========================================================
   白头鹰Sync — 设计系统（深色 / 浅色 双主题）
   ========================================================== */

/* ---------- 全局 token（与主题无关） ---------- */
:root {
    --r-xs: 8px;
    --r-sm: 10px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-full: 999px;

    --ease: cubic-bezier(.4, 0, .2, 1);
    --ease-spring: cubic-bezier(.2, .9, .3, 1.1);
    --t: .18s var(--ease);
    --t-fast: .12s var(--ease);
}

/* ---------- 深色主题（默认） ---------- */
html[data-theme="dark"] {
    --bg: #000000;
    --surface-1: #121214;
    --surface-2: #1c1c1e;
    --surface-hover: #232326;

    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #6e6e73;

    --border: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .18);
    --hairline: rgba(255, 255, 255, .14);

    --accent: #0a84ff;
    --accent-hover: #409cff;
    --accent-soft: rgba(10, 132, 255, .16);
    --danger: #ff453a;
    --danger-text: #ff8b83;
    --danger-soft: rgba(255, 69, 58, .14);
    --success-text: #6ee08a;
    --success-soft: rgba(48, 209, 88, .14);

    --nav-bg: rgba(18, 18, 20, .72);
    --pop-bg: rgba(28, 28, 30, .96);
    --field-focus-bg: #000000;
    --mask: rgba(0, 0, 0, .62);
    --hover-tint: rgba(255, 255, 255, .08);
    --th-bg: rgba(255, 255, 255, .03);
    --row-hover: rgba(255, 255, 255, .035);
    --glow: rgba(10, 132, 255, .10);
    --glow-2: rgba(48, 209, 88, .06);
    --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 26%, transparent);
    --scroll-thumb: rgba(255, 255, 255, .16);
    --scroll-thumb-hover: rgba(255, 255, 255, .28);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .55);
    --shadow-2: 0 8px 20px rgba(0, 0, 0, .45);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, .65);

    color-scheme: dark;
}

/* ---------- 浅色主题 ---------- */
html[data-theme="light"] {
    --bg: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #f5f5f7;
    --surface-hover: #ececf0;

    --text: #1d1d1f;
    --text-2: #6e6e73;
    --text-3: #86868b;

    --border: rgba(0, 0, 0, .10);
    --border-strong: rgba(0, 0, 0, .20);
    --hairline: rgba(0, 0, 0, .06);

    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-soft: rgba(0, 113, 227, .12);
    --danger: #e30000;
    --danger-text: #c70000;
    --danger-soft: rgba(227, 0, 0, .07);
    --success-text: #0a7d33;
    --success-soft: rgba(10, 125, 51, .09);

    --nav-bg: rgba(255, 255, 255, .78);
    --pop-bg: rgba(255, 255, 255, .98);
    --field-focus-bg: #ffffff;
    --mask: rgba(0, 0, 0, .34);
    --hover-tint: rgba(0, 0, 0, .06);
    --th-bg: #fbfbfd;
    --row-hover: #fbfbfd;
    --glow: rgba(0, 113, 227, .07);
    --glow-2: rgba(10, 125, 51, .05);
    --ring: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
    --scroll-thumb: rgba(0, 0, 0, .18);
    --scroll-thumb-hover: rgba(0, 0, 0, .30);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-2: 0 8px 20px rgba(0, 0, 0, .10);
    --shadow-3: 0 24px 60px rgba(0, 0, 0, .16);

    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: .01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--t), color var(--t);
}

a {
    color: inherit;
}

::selection {
    background: var(--accent-soft);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* 仅供屏幕阅读器 */
.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;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scroll-thumb-hover);
    background-clip: content-box;
}

/* ============================ logo ============================ */
.logo-img {
    display: block;
}

/* 深色主题用原图（黑底），screen 混合让黑底自然消隐 */
html[data-theme="dark"] .logo-img {
    mix-blend-mode: screen;
}

/* 按主题只显示对应的那张 logo */
html[data-theme="dark"] .only-light,
html[data-theme="light"] .only-dark {
    display: none !important;
}

/* ============================ 主题切换按钮 ============================ */
.theme-toggle {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color var(--t), background var(--t), transform var(--t);
}

.theme-toggle:hover {
    color: var(--text);
    background: var(--hover-tint);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(.95);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* 深色主题显示太阳（点击切到浅色），浅色主题显示月亮 */
html[data-theme="dark"] .icon-moon,
html[data-theme="light"] .icon-sun {
    display: none;
}

.theme-toggle.floating {
    position: fixed;
    top: 18px;
    right: 20px;
    z-index: 60;
}

/* ============================ 登录页 ============================ */
.auth-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
    background:
        radial-gradient(1100px 620px at 50% -14%, var(--glow), transparent 62%),
        radial-gradient(680px 460px at 8% 112%, var(--glow-2), transparent 60%),
        var(--bg);
}

/* 细腻的网点纹理，让大面积留白更有质感 */
.auth-page::before {
    content: "";
    position: absolute;
    inset: 0;
    color: var(--border-strong);
    background-image: radial-gradient(currentColor 1px, transparent 1px);
    background-size: 26px 26px;
    opacity: .45;
    -webkit-mask-image: radial-gradient(720px 440px at 50% 32%, #000, transparent 74%);
    mask-image: radial-gradient(720px 440px at 50% 32%, #000, transparent 74%);
    pointer-events: none;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 412px;
    padding: 50px 40px 36px;
    border: 1px solid transparent;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    text-align: center;
    /* 顶部更亮的描边，营造受光质感 */
    background:
        linear-gradient(var(--surface-1), var(--surface-1)) padding-box,
        linear-gradient(180deg, var(--border-strong), var(--border) 32%, var(--border)) border-box;
}

.auth-logo {
    display: flex;
    justify-content: center;
}

.auth-logo .logo-img {
    height: 92px;
    width: auto;
}

.auth-sys-name {
    margin: 14px 0 4px;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: .06em;
    color: var(--text);
}

.auth-title {
    margin: 18px 0 30px;
    font-size: 25px;
    font-weight: 600;
    letter-spacing: -.02em;
}

.auth-foot {
    margin: 26px 0 0;
    font-size: 12.5px;
    letter-spacing: .02em;
    color: var(--text-3);
}

/* ============================ 表单 ============================ */
.field {
    position: relative;
    margin-bottom: 14px;
    text-align: left;
}

.field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

.field .req {
    color: var(--danger);
    margin-left: 2px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    outline: none;
    transition: background var(--t), border-color var(--t), box-shadow var(--t);
}

.field input::placeholder {
    color: var(--text-3);
}

.field input:hover {
    background: var(--surface-hover);
}

.field input:focus {
    background: var(--field-focus-bg);
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
    transition: background-color 9999s ease-out;
}

/* 输入框前置图标 */
.field.has-icon input {
    padding-left: 46px;
}

.field-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: var(--text-3);
    pointer-events: none;
    transition: color var(--t);
}

.field-icon svg {
    width: 18px;
    height: 18px;
}

.field.has-icon:focus-within .field-icon {
    color: var(--accent);
}

.field.has-eye input {
    padding-right: 48px;
}

.field .eye {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    background: none;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: color var(--t), background var(--t);
}

.field .eye:hover {
    color: var(--text);
    background: var(--hover-tint);
}

.field .eye svg {
    width: 19px;
    height: 19px;
}

/* ============================ 按钮 ============================ */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 22px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .01em;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: background var(--t), border-color var(--t), color var(--t),
    transform var(--t-fast), box-shadow var(--t), opacity var(--t);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-2);
}

.btn:active {
    transform: translateY(0) scale(.985);
    box-shadow: var(--shadow-1);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.btn:disabled,
.btn.is-disabled {
    opacity: .45;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}

.btn svg {
    width: 17px;
    height: 17px;
    flex: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    color: #fff;
    background: var(--accent);
}

html[data-theme="dark"] .btn-primary {
    color: #0b1a2b;
    background: #f5f5f7;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .9);
}

html[data-theme="dark"] .btn-primary:hover {
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .95);
}

html[data-theme="light"] .btn-primary {
    box-shadow: 0 1px 2px rgba(0, 113, 227, .32), inset 0 1px 0 rgba(255, 255, 255, .22);
}

html[data-theme="light"] .btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 8px 22px rgba(0, 113, 227, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.btn-ghost {
    color: var(--text);
    background: transparent;
    border-color: var(--border-strong);
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--hover-tint);
    border-color: var(--text-3);
    box-shadow: none;
}

.btn-sm {
    height: 38px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: var(--r-sm);
}

.btn-sm svg {
    width: 15px;
    height: 15px;
}

/* ============================ 提示 ============================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 15px;
    margin-bottom: 18px;
    font-size: 14px;
    text-align: left;
    border-radius: var(--r-md);
    border: 1px solid transparent;
}

.alert-error {
    color: var(--danger-text);
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}

.alert-success {
    color: var(--success-text);
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success-text) 30%, transparent);
}

/* ============================ 记住我 ============================ */
.auth-row {
    display: flex;
    align-items: center;
    margin: 6px 0 24px;
    font-size: 14px;
    color: var(--text-2);
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    user-select: none;
}

.checkbox input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ============================ 导航栏 ============================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 56px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    gap: 36px;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(22px);
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    border-bottom: 1px solid var(--border);
}

.navbar .brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.navbar .brand .logo-img {
    height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    position: relative;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-2);
    text-decoration: none;
    transition: color var(--t);
}

.nav-links a:hover {
    color: var(--text);
}

.nav-links a.active {
    color: var(--text);
    font-weight: 500;
}

.nav-links a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    animation: navline .24s var(--ease-spring);
}

@keyframes navline {
    from {
        transform: scaleX(.4);
        opacity: 0;
    }
    to {
        transform: none;
        opacity: 1;
    }
}

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================ 头像与下拉 ============================ */
.user-menu {
    position: relative;
}

.avatar-btn {
    display: flex;
    padding: 2px;
    background: none;
    border: none;
    border-radius: var(--r-full);
    cursor: pointer;
    transition: transform var(--t);
}

.avatar-btn:hover {
    transform: scale(1.05);
}

.avatar {
    width: 34px;
    height: 34px;
    display: block;
    object-fit: contain;
    padding: 2px;
    background: #0b0b0d;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    flex: none;
}

.dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 192px;
    padding: 6px;
    background: var(--pop-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-3);
    display: none;
    animation: dd .16s ease-out;
}

@keyframes dd {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.dropdown.open {
    display: block;
}

.dropdown a,
.dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--t);
}

.dropdown a:hover,
.dropdown button:hover {
    background: var(--hover-tint);
}

.dropdown svg {
    width: 17px;
    height: 17px;
    color: var(--text-2);
    flex: none;
}

.dropdown .danger,
.dropdown .danger svg {
    color: var(--danger);
}

.dropdown .sep {
    height: 1px;
    margin: 6px;
    background: var(--border);
}

/* ============================ 页面容器 ============================ */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 44px 28px 80px;
}

.page-head {
    margin-bottom: 26px;
}

.page-title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -.025em;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 0 18px;
}

.toolbar-tip {
    margin-left: auto;
    padding: 5px 13px;
    font-size: 13px;
    color: var(--text-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-variant-numeric: tabular-nums;
}

.toolbar-tip b {
    color: var(--text);
    font-weight: 600;
}

/* 工具栏筛选：搭建人下拉框 */
.filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.select {
    height: 38px;
    padding: 0 32px 0 14px;
    font-family: inherit;
    font-size: 13.5px;
    color: var(--text);
    background-color: var(--surface-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color var(--t), box-shadow var(--t), background var(--t);
}

.select:hover {
    border-color: var(--text-3);
}

.select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

/* ============================ 表格 ============================ */
.table-wrap {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    /* 列较多时在卡片内横向滚动，避免表格撑破容器 */
    overflow-x: auto;
    box-shadow: var(--shadow-1);
}

/* 四角由单元格自身收边，替代 overflow 裁剪，避免裁掉悬停展开的卡片 */
thead th:first-child {
    border-top-left-radius: var(--r-lg);
}

thead th:last-child {
    border-top-right-radius: var(--r-lg);
}

tbody tr:last-child td:first-child {
    border-bottom-left-radius: var(--r-lg);
}

tbody tr:last-child td:last-child {
    border-bottom-right-radius: var(--r-lg);
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* 任务列表：列较多，设定最小宽度，窄屏时由 .table-wrap 横向滚动 */
.tasks-table {
    min-width: 1120px;
}

thead th {
    padding: 14px 16px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--text-3);
    text-align: left;
    background: var(--th-bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

thead th.num {
    text-align: right;
}

thead th.center {
    text-align: center;
}

tbody td {
    padding: 16px 16px;
    font-size: 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* 任务名称过长时省略，悬停显示完整名称（title） */
td.name-cell {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

tbody td.num {
    text-align: right;
    color: var(--text-2);
}

tbody td.center {
    text-align: center;
}

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

tbody tr {
    transition: background var(--t);
}

tbody tr:hover,
tbody tr:focus-within {
    position: relative;
    z-index: 5;
    background: var(--row-hover);
}

/* 勾选后整行高亮 */
tbody tr:has(.row-check:checked) {
    background: var(--accent-soft);
}

tbody tr:has(.row-check:checked):hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}

tbody td input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
    vertical-align: middle;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 25px;
    padding: 0 11px;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: var(--r-full);
}

/* 成功状态：成功 / 失败 两种配色 */
.pill-success {
    color: var(--success-text);
    background: var(--success-soft);
    border-color: color-mix(in srgb, var(--success-text) 30%, transparent);
}

.pill-danger {
    color: var(--danger-text);
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 32%, transparent);
}

/* ============================ 分页 ============================ */
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pager-info {
    font-size: 13px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.pager-info b {
    color: var(--text);
    font-weight: 600;
}

.pager-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 11px;
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-2);
    text-decoration: none;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: color var(--t), background var(--t), border-color var(--t), transform var(--t-fast);
}

.page-btn svg {
    width: 15px;
    height: 15px;
}

.page-btn:hover {
    color: var(--text);
    background: var(--hover-tint);
    border-color: var(--border-strong);
}

.page-btn:active {
    transform: scale(.96);
}

.page-btn.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.page-btn.disabled {
    opacity: .4;
    pointer-events: none;
}

/* 操作列：小尺寸描边按钮 */
td.ops {
    white-space: nowrap;
    text-align: right;
}

.ops-inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.op-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--t), background var(--t), border-color var(--t), transform var(--t-fast);
}

.op-btn svg {
    width: 14px;
    height: 14px;
    flex: none;
}

.op-btn:hover {
    color: var(--text);
    background: var(--hover-tint);
    border-color: var(--text-3);
}

.op-btn:active {
    transform: scale(.96);
}

.op-btn:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

.op-btn.danger:hover {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}

/* ============================ 操作按钮：Pill 悬停展开为 Card ============================ */
.act {
    position: relative;
    display: inline-flex;
    z-index: 1;
    vertical-align: middle;
}

/* 展开时抬升层级，避免被相邻行盖住 */
.act:hover,
.act:focus-within {
    z-index: 20;
}

/* 触发器：展开时下缘收平，与卡片连成一体 */
.act:hover > .act-trigger,
.act:focus-within > .act-trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
    transform: none;
    box-shadow: none;
}

/* 卡片主体：默认收起 */
.act-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 2;
    max-height: 0;
    padding: 0 13px;
    overflow: hidden;
    color: var(--text-2);
    background: var(--surface-1);
    border: 1px solid transparent;
    border-top: none;
    border-radius: 0 0 var(--r-sm) var(--r-sm);
    box-shadow: var(--shadow-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    text-align: left;
    white-space: normal;
    pointer-events: none;
    transition: max-height .22s var(--ease), padding .22s var(--ease),
    opacity var(--t), transform .22s var(--ease),
    visibility var(--t), border-color var(--t);
}

.act:hover > .act-panel,
.act:focus-within > .act-panel {
    max-height: 160px;
    padding: 10px 13px 13px;
    border-color: var(--border);
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
}

/* 窄按钮（表格操作列）：卡片向右下展开，避免文字挤压 */
.act-panel-wide {
    left: auto;
    right: 0;
    min-width: 186px;
}

.act-panel-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
}

.act-panel-desc {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-3);
}

.act-panel-danger .act-panel-title {
    color: var(--danger);
}

.empty {
    padding: 64px 0 !important;
    text-align: center;
    color: var(--text-3);
}

.empty svg {
    width: 34px;
    height: 34px;
    margin-bottom: 10px;
    opacity: .5;
}

/* ============================ 弹窗 ============================ */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    padding: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--mask);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-mask.open {
    display: flex;
    animation: fade .18s ease-out;
}

@keyframes fade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    width: 100%;
    max-width: 432px;
    max-height: 88vh;
    overflow: auto;
    padding: 26px 26px 30px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    animation: pop .2s var(--ease-spring);
}

@keyframes pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-head h3 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: -.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: var(--text-3);
    background: none;
    border: none;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background var(--t), color var(--t);
}

.modal-close:hover {
    color: var(--text);
    background: var(--hover-tint);
}

.profile {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.profile .avatar {
    width: 46px;
    height: 46px;
    padding: 3px;
}

.profile .name {
    font-size: 16px;
    font-weight: 600;
}

.profile .sub {
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-3);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 20px;
    font-size: 13.5px;
    color: var(--text-2);
    white-space: nowrap;
}

.section-title::before,
.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.modal .btn-block {
    margin-top: 8px;
}

/* ============================ 响应式 ============================ */
@media (max-width: 900px) {
    .navbar {
        gap: 20px;
        padding: 0 16px;
    }

    .container {
        padding: 28px 16px 60px;
    }

    .page-title {
        font-size: 24px;
    }

    .table-wrap {
        overflow-x: auto;
    }

    /* 触屏无悬停，且横向滚动会裁切，收起展开卡片 */
    .act-panel {
        display: none;
    }

    .navbar .brand .logo-img {
        height: 30px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 40px 24px 30px;
    }

    .auth-title {
        font-size: 22px;
    }
}

/* ============================ 无障碍：减弱动效 ============================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
