@font-face {
    font-family: 'HarmonyOS Sans SC';
    src: url('fonts/HarmonyOS_Sans_SC_Regular.woff2') format('woff2'),
         url('fonts/HarmonyOS_Sans_SC_Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'HarmonyOS Sans SC';
    src: url('fonts/HarmonyOS_Sans_SC_Medium.woff2') format('woff2'),
         url('fonts/HarmonyOS_Sans_SC_Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: block;
}
@font-face {
    font-family: 'HarmonyOS Sans SC';
    src: url('fonts/HarmonyOS_Sans_SC_Bold.woff2') format('woff2'),
         url('fonts/HarmonyOS_Sans_SC_Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

:root {
    --bg: #e8f4fd;
    --bg-alt: #d5ebfa;
    --surface: #f0f8ff;
    --surface-soft: #e3f2fc;
    --surface-muted: #d8edfa;
    --surface-elevated: #f5faff;
    --primary: #2a9df4;
    --primary-dark: #1b78c6;
    --primary-light: #5cb8f5;
    --accent: #57d0d4;
    --success: #1fa98c;
    --warning: #f3a15f;
    --danger: #f26b6b;
    --text-primary: #0f3a5e;
    --text-secondary: #3d5c78;
    --text-muted: #6b8ca8;
    --border: #b8daf2;
    --border-strong: #8dc5ec;
    --border-light: #d0e8f7;
    --shadow-soft: 0 8px 24px rgba(42, 157, 244, 0.12);
    --shadow-hover: 0 12px 32px rgba(42, 157, 244, 0.18);
    --shadow-card: 0 6px 20px rgba(42, 157, 244, 0.10);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    
    /* 新增动画变量 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s ease;
    
    /* 新增渐变 */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    --gradient-dark: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --gradient-glow: radial-gradient(circle at 50% 50%, rgba(42, 157, 244, 0.15), transparent 70%);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family);
    background: linear-gradient(135deg, #dce9f7 0%, #e8f4fd 50%, #d5ebfa 100%);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 25% 25%, rgba(92, 184, 245, 0.15), transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(87, 208, 212, 0.12), transparent 50%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

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

::-webkit-scrollbar-track {
    background: rgba(207, 230, 247, 0.4);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 181, 255, 0.65);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 181, 255, 0.85);
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: linear-gradient(135deg, rgba(240, 248, 255, 0.95) 0%, rgba(227, 242, 252, 0.95) 100%);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 4px 16px rgba(42, 157, 244, 0.12);
    display: flex;
    justify-content: center;
    padding: 0 1.5rem;
}

.topbar-inner {
    width: min(1180px, 100%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.85rem 0;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar-brand span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--surface-elevated);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.topbar-brand h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-dark), #0d487a);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-menu-btn {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    position: relative;
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.mobile-menu-btn span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 2px;
    background: var(--primary-dark);
    border-radius: 999px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.mobile-menu-btn span:nth-child(1) { top: 14px; }
.mobile-menu-btn span:nth-child(2) { top: 21px; }
.mobile-menu-btn span:nth-child(3) { top: 28px; }

.mobile-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-nav a {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.topbar-nav a:hover {
    color: var(--primary-dark);
    border-color: rgba(42, 157, 244, 0.35);
    background: rgba(42, 157, 244, 0.08);
}

.topbar-nav a.active {
    color: var(--surface-elevated);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 8px 20px rgba(42, 157, 244, 0.28);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: rgba(42, 157, 244, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.logout-btn {
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--surface-elevated);
    background: linear-gradient(135deg, #f0747a 0%, #f24b68 100%);
    box-shadow: 0 10px 20px rgba(242, 75, 104, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px rgba(242, 75, 104, 0.35);
}

.topbar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 58, 94, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    z-index: 40;
    transition: opacity 0.25s ease;
}

.topbar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-content {
    flex: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 2.8rem 2.5rem 3.6rem;
}

.dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.dashboard-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface) 100%);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 2.4rem 2.6rem;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: -30% 30% 30% -30%;
    background: radial-gradient(circle at 0% 0%, rgba(92, 184, 245, 0.15), transparent 60%);
    opacity: 0.8;
}

.dashboard-hero::after {
    content: '';
    position: absolute;
    inset: 20% -20% -30% 40%;
    background: radial-gradient(circle at 80% 0%, rgba(87, 208, 212, 0.12), transparent 65%);
    opacity: 0.8;
}

.dashboard-hero .hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.hero-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.hero-text-group {
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.hero-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.hero-title {
    font-size: clamp(2rem, 3vw, 2.4rem);
    font-weight: 700;
    color: var(--text-primary);
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.hero-action-btn {
    padding: 0.65rem 1.35rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: var(--surface-elevated);
    border: none;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: 0 12px 28px rgba(42, 157, 244, 0.30);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(42, 157, 244, 0.35);
}

.hero-action-btn.secondary {
    background: rgba(42, 157, 244, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(42, 157, 244, 0.35);
    box-shadow: none;
}

.hero-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.2rem;
}

.hero-metric-card {
    background: var(--surface-soft);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hero-metric-card .metric-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.hero-metric-card .metric-label {
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
}

.panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem 2.2rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    position: relative;
    overflow: hidden;
}

.panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(245, 250, 255, 0.6);
    pointer-events: none;
}

.panel-header h3 {
    font-size: 1.4rem;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
}

.panel-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.panel-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
    gap: 1rem;
}

.panel-metric {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.panel-metric-label {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.panel-metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.panel-footnote {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.earnings-distribution {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.distribution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

.distribution-list-scroll {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

.distribution-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.distribution-item {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.distribution-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border-strong);
}

.distribution-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.distribution-label {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.distribution-value {
    font-weight: 700;
    color: var(--success);
}

.distribution-item.negative .distribution-value {
    color: var(--danger);
}

.distribution-bar-track {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(207, 230, 247, 0.8);
    overflow: hidden;
}

.distribution-bar {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
}

.distribution-item.negative .distribution-bar {
    background: linear-gradient(90deg, rgba(242, 107, 107, 0.85), rgba(242, 150, 116, 0.7));
}

.distribution-empty,
.no-data-message {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-style: italic;
}

.insights-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.insight-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: rgba(42, 157, 244, 0.1);
    border: 1px solid rgba(42, 157, 244, 0.35);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(42, 157, 244, 0.18);
}

.machines-grid {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.machine-card {
    position: relative;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(247, 252, 255, 0.98) 0%, rgba(236, 248, 255, 0.96) 100%),
        radial-gradient(circle at 96% 0%, rgba(87, 208, 212, 0.12), transparent 28%);
    border-radius: 16px;
    padding: 0;
    border: 1px solid rgba(141, 197, 236, 0.56);
    box-shadow: 0 2px 5px rgba(15, 58, 94, 0.08), 0 10px 24px rgba(42, 157, 244, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
    overflow: hidden;
    font-family: 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.machine-card.has-alert {
    padding-bottom: 0;
}

.machine-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 0 18px rgba(42, 157, 244, 0.26);
    z-index: 2;
    transition: width 0.22s ease, box-shadow 0.22s ease;
}

.machine-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(42, 157, 244, 0.08), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(87, 208, 212, 0.14), transparent 34%);
    background-size: 100% 100%;
    background-position: 0 0;
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.22s ease;
    z-index: 0;
}

.machine-card > * {
    position: relative;
    z-index: 1;
}

.machine-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(15, 58, 94, 0.1), 0 16px 32px rgba(42, 157, 244, 0.16);
    border-color: rgba(42, 157, 244, 0.68);
}

.machine-card:hover::before {
    width: 6px;
    box-shadow: 0 0 26px rgba(42, 157, 244, 0.38);
}

.machine-card:hover::after {
    opacity: 0.85;
}

.machine-card.error-card::before,
.machine-card.machine-offline::before {
    background: linear-gradient(180deg, var(--danger) 0%, #f3a15f 100%);
    box-shadow: 0 0 22px rgba(242, 107, 107, 0.34);
}

.machine-card.error-card {
    border-color: rgba(242, 107, 107, 0.4);
    background:
        linear-gradient(180deg, rgba(255, 250, 250, 0.98) 0%, rgba(253, 240, 240, 0.94) 100%),
        radial-gradient(circle at 96% 8%, rgba(242, 107, 107, 0.12), transparent 28%);
}

.machine-card.machine-unlisted:not(.error-card) {
    border-color: rgba(243, 161, 95, 0.36);
}

.machine-card.machine-unlisted:not(.error-card)::before {
    background: linear-gradient(180deg, var(--warning) 0%, #f6c177 100%);
    box-shadow: 0 0 20px rgba(243, 161, 95, 0.28);
}

@keyframes errorPulse {
    0%, 100% { border-color: rgba(242, 107, 107, 0.35); }
    50% { border-color: rgba(242, 107, 107, 0.55); }
}

/* === Machines page layout: cards + sidebar === */
.machines-layout {
    display: flex;
    gap: 1.15rem;
    align-items: flex-start;
}

.machines-layout .machines-grid {
    flex: 1;
    min-width: 0;
}

.gpu-earnings-sidebar {
    width: 260px;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 100% 0%, rgba(87, 208, 212, 0.16), transparent 38%),
        linear-gradient(150deg, rgba(245, 250, 255, 0.96) 0%, rgba(227, 242, 252, 0.9) 100%);
    border: 1px solid rgba(141, 197, 236, 0.58);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 1.2rem;
    font-family: 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    height: 500px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gpu-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    background: rgba(240, 248, 255, 0.72);
    flex-shrink: 0;
}

.gpu-sidebar-title {
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.gpu-sidebar-live {
    font-size: 0.6875rem;
    color: var(--success);
    font-weight: 700;
}

.gpu-sidebar-search {
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: rgba(245, 250, 255, 0.74);
    outline: none;
    font-family: inherit;
    flex-shrink: 0;
    box-sizing: border-box;
}

.gpu-sidebar-search::placeholder {
    color: var(--text-muted);
}

.gpu-sidebar-search:focus {
    background: var(--surface-elevated);
    box-shadow: inset 0 -1px 0 rgba(42, 157, 244, 0.32);
}

.gpu-sidebar-list {
    overflow-y: auto;
    padding: 0;
    flex: 1;
}

.gpu-sidebar-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.62rem 1rem;
    border-bottom: 1px solid rgba(184, 218, 242, 0.6);
    transition: background 0.16s ease, transform 0.16s ease;
}

.gpu-sidebar-item:nth-child(even) {
    background: rgba(240, 248, 255, 0.48);
}

.gpu-sidebar-item:hover {
    background: rgba(42, 157, 244, 0.1);
    transform: translateX(2px);
}

.gpu-sidebar-item:last-child {
    border-bottom: none;
}

.gpu-sidebar-model {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.gpu-sidebar-earn {
    text-align: right;
    flex-shrink: 0;
}

.gpu-sidebar-daily {
    font-weight: 700;
    font-size: 0.8125rem;
    color: var(--success);
}

.gpu-sidebar-daily-unit {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-weight: 400;
}

.gpu-sidebar-hourly {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.gpu-sidebar-loading {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* === Row 1: Header bar === */
.mc-row1 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem 0.85rem 1.35rem;
    border-bottom: 1px solid rgba(184, 218, 242, 0.58);
    background: rgba(245, 250, 255, 0.66);
    font-size: 0.8125rem;
}

.mc-identity {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex-wrap: nowrap;
}

.mc-id {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 34px;
    padding: 0.28rem 0.62rem;
    border-radius: 10px;
    border: 1px solid rgba(42, 157, 244, 0.24);
    background: rgba(42, 157, 244, 0.08);
    font-weight: 700;
    font-size: inherit;
    color: var(--primary-dark);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.mc-title-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 0;
}

.mc-hostname {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.mc-gpu-title {
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mc-tags {
    display: flex;
    gap: 0.28rem;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.mc-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.42rem;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.mc-tag.tag-online { color: var(--success); background: rgba(31, 169, 140, 0.1); border-color: rgba(31, 169, 140, 0.3); }
.mc-tag.tag-offline { color: var(--danger); background: rgba(242, 107, 107, 0.1); border-color: rgba(242, 107, 107, 0.28); }
.mc-tag.tag-verified { color: var(--primary-dark); background: rgba(42, 157, 244, 0.11); border-color: rgba(42, 157, 244, 0.28); }
.mc-tag.tag-unverified { color: #b46a16; background: rgba(243, 161, 95, 0.12); border-color: rgba(243, 161, 95, 0.32); }
.mc-tag.tag-error { color: var(--danger); background: rgba(242, 107, 107, 0.1); border-color: rgba(242, 107, 107, 0.28); }
.mc-tag.tag-normal { color: var(--success); background: rgba(31, 169, 140, 0.1); border-color: rgba(31, 169, 140, 0.3); }
.mc-tag.tag-listed { color: var(--success); background: rgba(31, 169, 140, 0.1); border-color: rgba(31, 169, 140, 0.3); }
.mc-tag.tag-unlisted { color: #b46a16; background: rgba(243, 161, 95, 0.12); border-color: rgba(243, 161, 95, 0.32); }

.mc-spacer { flex: 1; }

.mc-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

.mc-toolbar:empty {
    display: none;
}

.mc-price {
    font-weight: 700;
    font-size: inherit;
    color: var(--success);
    padding: 0.36rem 0.72rem;
    border-radius: 10px;
    background: rgba(31, 169, 140, 0.08);
    border: 1px solid rgba(31, 169, 140, 0.2);
    flex-shrink: 0;
    white-space: nowrap;
}

.mc-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
}

.mc-actions button {
    min-width: 72px;
    min-height: 38px;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: inherit;
    font-weight: 700;
    border: 1px solid transparent;
    line-height: 1;
    letter-spacing: 0.02em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}

.mc-actions button:hover {
    transform: translateY(-2px);
}

.mc-actions button:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(15, 58, 94, 0.18);
}

.mc-actions button:focus-visible {
    outline: 3px solid rgba(92, 184, 245, 0.36);
    outline-offset: 2px;
}

.mc-btn-primary {
    background: var(--primary);
    color: var(--surface-elevated);
    border-color: var(--primary);
    box-shadow: 0 3px 8px rgba(42, 157, 244, 0.28);
}
.mc-btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 6px 14px rgba(42, 157, 244, 0.34);
}

.mc-btn-secondary {
    background: rgba(255, 255, 255, 0.76);
    color: var(--primary-dark);
    border-color: rgba(42, 157, 244, 0.34);
    box-shadow: none;
}
.mc-btn-secondary:hover {
    color: var(--primary-dark);
    background: rgba(42, 157, 244, 0.08);
    border-color: rgba(42, 157, 244, 0.5);
    box-shadow: 0 3px 8px rgba(42, 157, 244, 0.12);
}

/* === Row 2: Hardware specs grid === */
.mc-row2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    padding: 0.72rem 1rem 0 1.35rem;
    border-bottom: none;
}

.mc-cell {
    display: flex;
    flex-direction: column;
    gap: 0.24rem;
    padding: 0.62rem 0.75rem;
    border: 1px solid rgba(184, 218, 242, 0.48);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    min-width: 0;
    overflow: hidden;
    min-height: 3.2rem;
    justify-content: center;
}

.mc-cell:last-child {
    border-right: 1px solid rgba(184, 218, 242, 0.48);
}

.mc-cell-lbl {
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.mc-cell-val {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.8125rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.mc-cell-val.val-highlight {
    color: #1e40af;
    font-weight: 700;
}

/* === Row 3: Status bar === */
.mc-row3 {
    display: flex;
    align-items: center;
    gap: 0.375rem 1rem;
    padding: 0.78rem 1rem 0.88rem 1.35rem;
    flex-wrap: wrap;
    background: linear-gradient(90deg, rgba(240, 248, 255, 0.7) 0%, rgba(245, 250, 255, 0.5) 100%);
    border-top: 1px solid rgba(184, 218, 242, 0.58);
}

.mc-spec {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.36rem 0.64rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(184, 218, 242, 0.44);
    white-space: nowrap;
}

.mc-spec-lbl {
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
}

.mc-price-spec {
    background: rgba(31, 169, 140, 0.08);
    border-color: rgba(31, 169, 140, 0.24);
}

.mc-price-spec-val {
    color: var(--success);
    font-weight: 700;
}

.mc-spec-val {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.gpu-called,
.gpu-free {
    display: inline;
    padding: 0.16rem 0.5rem;
    margin: 0 0.125rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.gpu-called {
    color: var(--danger);
    background: rgba(242, 107, 107, 0.1);
}

.gpu-free {
    color: var(--success);
    background: rgba(31, 169, 140, 0.1);
}

.machine-alert {
    margin: 0 1rem 1rem 1.35rem;
    padding: 0.62rem 0.8rem;
    border-radius: 12px;
    background: rgba(242, 107, 107, 0.1);
    border: 1px solid rgba(242, 107, 107, 0.24);
    color: #bf3030;
    font-weight: 600;
    font-size: 0.75rem;
    line-height: 1.5;
    word-break: break-all;
    overflow-wrap: break-word;
    max-height: 4.5rem;
    overflow-y: auto;
}

.power-info {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.mc-spec-val.power-info.low-power,
.power-info.low-power {
    color: var(--success);
    background: rgba(31, 169, 140, 0.08);
    border-color: rgba(31, 169, 140, 0.32);
}

.mc-spec-val.power-info.medium-power,
.power-info.medium-power {
    color: var(--warning);
    background: rgba(243, 161, 95, 0.1);
    border-color: rgba(243, 161, 95, 0.32);
}

.mc-spec-val.power-info.high-power,
.power-info.high-power {
    color: var(--danger);
    background: rgba(242, 107, 107, 0.1);
    border-color: rgba(242, 107, 107, 0.32);
}

.mc-spec-val.power-info.power-offline,
.power-info.power-offline {
    color: var(--text-muted);
    background: var(--surface-muted);
    border-color: var(--border-light);
}

/* 稳定性等级样式 */
.reliability-high {
    color: var(--success);
    font-weight: 700;
}

.reliability-medium {
    color: var(--warning);
    font-weight: 700;
}

.reliability-low {
    color: var(--danger);
    font-weight: 700;
}

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

.status-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.6rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
}

.status-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.05rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface-soft);
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.status-filter-btn .status-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-light);
}

.status-filter-btn:hover {
    color: var(--primary-dark);
    border-color: rgba(42, 157, 244, 0.45);
    background: rgba(42, 157, 244, 0.12);
}

.status-filter-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: transparent;
    color: var(--surface-elevated);
    box-shadow: 0 10px 24px rgba(42, 157, 244, 0.3);
}

.status-filter-btn.active .status-count {
    background: rgba(245, 250, 255, 0.25);
    border-color: rgba(245, 250, 255, 0.3);
    color: var(--surface-elevated);
}

.finance-overview,
    .finance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.6rem;
}

.finance-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.finance-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(245, 250, 255, 0.6);
    pointer-events: none;
}

.finance-card h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.finance-value {
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.finance-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.balance-card {
    position: relative;
}

.withdraw-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.6rem 1.8rem;
    background: linear-gradient(135deg, #2a9df4, #1e7fd0);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    z-index: 2;
}

.withdraw-btn:hover {
    background: linear-gradient(135deg, #1e7fd0, #1565b0);
    box-shadow: 0 2px 8px rgba(42, 157, 244, 0.3);
}

/* 提现弹窗 */
.withdraw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.withdraw-modal {
    background: #fff;
    border-radius: 12px;
    width: 460px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.withdraw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.withdraw-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.withdraw-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.25rem;
}

.withdraw-modal-close:hover { color: #475569; }

.withdraw-modal-body {
    padding: 1.5rem;
}

.withdraw-loading {
    text-align: center;
    padding: 2rem;
    color: #94a3b8;
}

.withdraw-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.withdraw-info-row:last-child { border-bottom: none; }

.withdraw-info-lbl {
    color: #64748b;
    font-size: 0.9375rem;
}

.withdraw-info-val {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #0f172a;
}

.withdraw-info-val.amount {
    color: #059669;
    font-size: 1.125rem;
    font-weight: 700;
}

.withdraw-status-msg {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.withdraw-status-msg.info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.withdraw-status-msg.warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.withdraw-status-msg.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.withdraw-status-msg.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.withdraw-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.withdraw-cancel-btn {
    padding: 0.5rem 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #475569;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.withdraw-cancel-btn:hover { background: #f1f5f9; }

.withdraw-confirm-btn {
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.withdraw-confirm-btn:hover {
    background: linear-gradient(135deg, #047857, #065f46);
}

.withdraw-confirm-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

.query-section,
.finance-section,
.chart-container,
.withdrawal-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 1.8rem 2rem;
    display: flex;
        flex-direction: column;
    gap: 1.3rem;
}

.query-section h3,
.finance-section h3,
.withdrawal-section h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.query-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    align-items: flex-end;
}

.query-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 180px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface-elevated);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 157, 244, 0.12);
}

.query-btn,
.refresh-btn,
.page-btn,
.machine-page-btn {
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--surface-elevated);
    font-weight: 600;
    border: none;
    box-shadow: 0 12px 24px rgba(42, 157, 244, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.query-btn:hover,
.refresh-btn:hover,
.page-btn:hover:not(:disabled),
.machine-page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(42, 157, 244, 0.34);
}

.page-btn:disabled,
.machine-page-btn:disabled {
    background: rgba(207, 230, 247, 0.8);
    color: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.results-table-container,
.machine-results-table-container,
.withdrawal-table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background: var(--surface-elevated);
}

.results-table,
.machine-results-table,
.withdrawal-table,
.earnings-table,
.expenses-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.results-table th,
.machine-results-table th,
.withdrawal-table th,
.earnings-table th,
.expenses-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--surface-soft);
    border-bottom: 1px solid var(--border-light);
}

.results-table td,
.machine-results-table td,
.withdrawal-table td,
.earnings-table td,
.expenses-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.withdrawal-table th {
    padding: 0.6rem 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
}

.withdrawal-table td {
    padding: 0.6rem 0.5rem;
    font-size: 0.85rem;
}

.results-table tbody tr:hover,
.machine-results-table tbody tr:hover,
.withdrawal-table tbody tr:hover {
    background: var(--surface-soft);
}

.pagination,
.machine-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    color: var(--text-secondary);
}

.page-info,
.machine-page-info {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-card,
.machine-summary-card {
    background: linear-gradient(135deg, rgba(42, 157, 244, 0.92), rgba(87, 208, 212, 0.92));
    color: var(--surface-elevated);
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 32px rgba(42, 157, 244, 0.28);
    text-align: center;
}

.summary-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.85rem;
    opacity: 0.8;
}

.summary-value {
    font-size: 2.3rem;
    font-weight: 700;
    margin: 0.4rem 0;
}

.summary-period {
    font-size: 0.95rem;
    opacity: 0.85;
}

.bill-status {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}

.status-pending {
    color: var(--warning);
    background: rgba(243, 161, 95, 0.12);
    border-color: rgba(243, 161, 95, 0.35);
}

.status-pre-paid {
    color: var(--primary-dark);
    background: rgba(42, 157, 244, 0.12);
    border-color: rgba(42, 157, 244, 0.35);
}

.status-paid {
    color: var(--success);
    background: rgba(31, 169, 140, 0.12);
    border-color: rgba(31, 169, 140, 0.35);
}

.status-unknown {
    color: var(--text-muted);
    background: var(--surface-soft);
    border-color: var(--border-light);
}

.message {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-soft);
    border: 1px solid var(--border-light);
}

.message.error {
    color: var(--danger);
    background: rgba(242, 107, 107, 0.1);
    border-color: rgba(242, 107, 107, 0.3);
}

.message.success {
    color: var(--success);
    background: rgba(31, 169, 140, 0.1);
    border-color: rgba(31, 169, 140, 0.3);
}

.machine-details,
.machine-earnings-modal,
.bill-details-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 58, 94, 0.45);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 80;
}

.machine-details.show,
.machine-earnings-modal,
.bill-details-modal {
    display: flex;
}

.machine-details .detail-card,
.machine-earnings-modal-content,
.bill-details-modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-hover);
    width: min(780px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.8rem 2rem;
}

.detail-section {
    margin-bottom: 1.6rem;
}

.detail-section h4 {
    margin: 0 0 0.8rem;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
    color: var(--text-secondary);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
}

.detail-value {
    flex: 1;
    text-align: right;
}

.detail-error-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: rgba(242, 107, 107, 0.12);
    border: 1px solid rgba(242, 107, 107, 0.35);
    color: var(--danger);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.close-modal-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--surface-soft);
    color: var(--text-primary);
    font-size: 1.2rem;
    display: grid;
    place-items: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.close-modal-btn:hover {
    transform: rotate(10deg);
    background: rgba(42, 157, 244, 0.15);
    color: var(--primary-dark);
}

.loading {
    color: var(--text-secondary);
    padding: 2rem;
    text-align: center;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #dce9f7 0%, #e8f4fd 50%, #d5ebfa 100%);
    padding: 2rem 1rem;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(92, 184, 245, 0.18), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(87, 208, 212, 0.15), transparent 50%);
    pointer-events: none;
}

.login-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 3rem 2.8rem;
    box-shadow: 0 16px 48px rgba(42, 157, 244, 0.18);
    border: 1px solid var(--border-light);
}

.login-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(245, 250, 255, 0.7);
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 0.6rem;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2a9df4 0%, #5cb8f5 100%);
    color: var(--surface-elevated);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    box-shadow: 0 8px 20px rgba(42, 157, 244, 0.25);
}

.login-logo h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1a5a8a;
}

.login-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #6b8ca8;
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.login-form .form-group {
    display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
.login-form label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a6b85;
}

.login-form input {
        width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--surface-elevated);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    color: var(--text-primary);
}

.login-form input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 157, 244, 0.12);
    background: var(--surface-elevated);
}

.login-btn {
    margin-top: 0.5rem;
    padding: 0.85rem;
    border-radius: var(--radius-sm);
        font-weight: 600;
    font-size: 1rem;
    background: linear-gradient(135deg, #2a9df4 0%, #5cb8f5 100%);
    color: var(--surface-elevated);
    border: none;
    box-shadow: 0 10px 24px rgba(42, 157, 244, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(42, 157, 244, 0.32);
    background: linear-gradient(135deg, #1b8ee6 0%, #4daff0 100%);
}

.login-btn:active {
    transform: translateY(0);
}

@keyframes powerUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

@media (max-width: 1280px) {
    .topbar-inner,
    .main-content {
        width: 100%;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

}

@media (max-width: 1024px) {
    .mc-row1 { gap: 0.6rem; font-size: 0.85rem; }
    .mc-gpu-title { font-size: 0.8rem; }
    .mc-row2 { grid-template-columns: repeat(4, 1fr); }
    .gpu-earnings-sidebar { width: 220px; height: 600px; }
}

@media (max-width: 960px) {
    .topbar {
        padding: 0 1rem;
    }

    .topbar-inner {
        padding: 0.75rem 0;
        gap: 1rem;
    }

    .topbar-left {
        min-width: 0;
    }

    .mobile-menu-btn {
        display: inline-block;
    }

    .topbar-nav {
    position: fixed;
        top: 76px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, rgba(240, 248, 255, 0.98) 0%, rgba(227, 242, 252, 0.98) 100%);
        border-bottom: 1px solid var(--border-light);
        box-shadow: 0 12px 28px rgba(42, 157, 244, 0.15);
        border-radius: 0 0 20px 20px;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.2rem 1.5rem;
        gap: 0.5rem;
        transform: translateY(-20px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.25s ease, opacity 0.25s ease;
        z-index: 55;
    }

    .topbar-nav.open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .topbar-nav a {
        width: 100%;
    }

    .topbar-actions {
        margin-left: 0;
        gap: 0.65rem;
        flex-shrink: 0;
    }

    .logout-btn {
        padding: 0.5rem 0.95rem;
        font-size: 0.84rem;
        box-shadow: 0 8px 18px rgba(242, 75, 104, 0.22);
    }
    
    .main-content {
        padding: 2.2rem 1.5rem 3rem;
    }

    .dashboard-hero,
    .panel,
    .finance-section,
    .query-section,
    .withdrawal-section,
    .chart-container {
        padding: 1.6rem;
    }

    .finance-overview,
    .finance-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .query-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .query-form .form-group {
        min-width: 0;
    }

    .query-btn {
        width: 100%;
        justify-content: center;
        grid-column: 1 / -1;
    }

    .withdraw-modal {
        width: min(560px, calc(100vw - 1.5rem));
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .withdraw-modal-body {
        max-height: min(65vh, 560px);
        overflow-y: auto;
    }

    .withdraw-modal-footer {
        flex-wrap: wrap;
    }

    .machine-details,
    .machine-earnings-modal,
    .bill-details-modal {
        padding: 1rem;
    }
    
    .mc-row1 { grid-template-columns: 1fr; align-items: stretch; }
    .mc-toolbar { justify-content: space-between; }
    .mc-row2 { grid-template-columns: repeat(2, 1fr); }
    .mc-cell { padding: 0.55rem 0.65rem; }
    .machines-layout { flex-direction: column; }
    .gpu-earnings-sidebar { width: 100%; position: static; height: auto; max-height: 300px; order: -1; margin-bottom: 0.75rem; }
    .gpu-sidebar-list { max-height: 200px; flex: none; }

    .login-box {
        max-width: 480px;
        padding: 2.6rem 2.2rem;
    }
}

@media (max-width: 640px) {
    .topbar-inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 0.75rem;
    }

    .topbar-left {
        gap: 0.75rem;
        min-width: 0;
    }

    .topbar-brand {
        min-width: 0;
    }

    .topbar-brand h1 {
        font-size: 1.15rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-nav {
        top: 72px;
        max-height: calc(100vh - 88px);
        overflow-y: auto;
        padding: 1rem 1rem 1.1rem;
    }

    .topbar-nav a {
        min-height: 46px;
        display: flex;
        align-items: center;
    }

    .user-chip {
        display: none;
    }

    .topbar-actions {
        gap: 0.5rem;
    }

    .logout-btn {
        padding: 0.52rem 0.82rem;
        font-size: 0.8rem;
        box-shadow: none;
        min-height: 40px;
    }
    
    .main-content {
        padding: 2rem 1.1rem 2.6rem;
    }

    .dashboard-hero {
        padding: 1.4rem 1.3rem;
    }

    .hero-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-action-btn {
        flex: 1;
        justify-content: center;
    }

    .panel-grid {
        grid-template-columns: 1fr;
        gap: 1.4rem;
    }

    .finance-overview,
    .finance-cards {
        grid-template-columns: 1fr;
    }

    .finance-card {
        padding: 1.25rem;
    }

    .finance-value {
        font-size: 1.7rem;
    }

    .balance-card {
        gap: 0.8rem;
    }

    .withdraw-btn {
        position: static;
        width: 100%;
        margin: 0;
        padding: 0.72rem 1rem;
    }

    .query-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .query-form .form-group,
    .query-btn {
        width: 100%;
    }

    .query-btn {
        min-height: 46px;
    }
    
    .results-table,
    .machine-results-table,
    .withdrawal-table,
    .earnings-table,
    .expenses-table {
        min-width: 100%;
    }

    .results-table-container,
    .machine-results-table-container,
    .withdrawal-table-container {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .responsive-table {
        width: 100%;
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0;
        background: transparent;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody {
        display: grid;
        gap: 0.85rem;
    }

    .responsive-table tbody tr {
        display: block;
        background: var(--surface-elevated);
        border: 1px solid var(--border-light);
        border-radius: 14px;
        overflow: hidden;
        box-shadow: var(--shadow-soft);
    }

    .responsive-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.9rem;
        white-space: normal;
        text-align: right;
        padding: 0.72rem 0.9rem;
        border-bottom: 1px solid rgba(184, 218, 242, 0.38);
    }

    .responsive-table tbody td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        text-align: left;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .responsive-table tbody td:last-child {
        border-bottom: none;
    }

    .responsive-table tbody td.no-data,
    .responsive-table tbody td[colspan] {
        display: block;
        text-align: center;
        padding: 1rem 0.9rem;
    }

    .responsive-table tbody td.no-data::before,
    .responsive-table tbody td[colspan]::before {
        content: none;
    }

    .responsive-table tbody td[data-label="收款账号"],
    .responsive-table tbody td[data-label="描述"] {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .pagination,
    .machine-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .page-btn,
    .machine-page-btn {
        width: 100%;
        justify-content: center;
    }

    .page-info,
    .machine-page-info {
        width: 100%;
        text-align: center;
        font-size: 0.88rem;
    }

    .withdraw-modal {
        width: calc(100vw - 0.8rem);
        border-radius: 14px;
    }

    .withdraw-modal-header,
    .withdraw-modal-body,
    .withdraw-modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .withdraw-modal-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .withdraw-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .withdraw-cancel-btn,
    .withdraw-confirm-btn {
        width: 100%;
        min-height: 44px;
    }

    .summary-card,
    .machine-summary-card {
        padding: 1.2rem;
    }

    .summary-value {
        font-size: 1.9rem;
    }

    .status-filter-group {
        padding: 0.9rem;
        gap: 0.5rem;
    }

    .status-filter-btn {
        flex: 1 1 calc(50% - 0.25rem);
        justify-content: space-between;
        min-width: 0;
    }

    .status-filter-btn .status-count {
        min-width: 24px;
        padding: 0.25rem 0.5rem;
    }
    
    .machine-card { border-radius: 14px; }
    .mc-row1 { gap: 0.75rem; padding: 0.84rem 0.85rem 0.78rem 1.1rem; }
    .mc-identity { align-items: flex-start; gap: 0.6rem; flex-wrap: wrap; }
    .mc-title-stack { flex: 1 1 180px; flex-direction: column; align-items: flex-start; gap: 0.12rem; }
    .mc-tags { width: 100%; flex-wrap: wrap; }
    .mc-gpu-title { font-size: 0.8rem; }
    .mc-spacer { display: none; }
    .mc-toolbar { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .mc-actions { width: 100%; justify-content: flex-end; }
    .mc-actions button { min-height: 38px; padding: 0.5rem 0.8rem; font-size: 0.75rem; }
    .mc-row2 { grid-template-columns: repeat(2, 1fr); padding: 0.6rem 0.8rem 0 1.1rem; gap: 0.55rem; }
    .mc-cell { padding: 0.5rem 0.58rem; min-height: 3rem; }
    .mc-cell-val { font-size: 0.78rem; }
    .mc-row3 { padding: 0.72rem 0.8rem 0.78rem 1.1rem; }
    .machine-alert { margin: 0 0.8rem 0.85rem 1.1rem; }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .detail-value {
        text-align: left;
    }

    .detail-label {
        min-width: 0;
    }
    
    .machine-details .detail-card,
    .machine-earnings-modal-content,
    .bill-details-modal-content {
        padding: 1.3rem 1.4rem;
    }

    .login-box {
        padding: 2.2rem 1.8rem;
    }

    .login-logo {
        gap: 0.7rem;
    }

    .logo-icon {
        width: 46px;
        height: 46px;
        font-size: 1rem;
    }

    .login-logo h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 0 0.75rem;
    }

    .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }

    .mobile-menu-btn span:nth-child(1) { top: 12px; }
    .mobile-menu-btn span:nth-child(2) { top: 19px; }
    .mobile-menu-btn span:nth-child(3) { top: 26px; }

    .hero-metric-card .metric-value {
        font-size: 1.8rem;
    }

    .hero-actions {
        gap: 0.6rem;
    }

    .panel {
        padding: 1.35rem 1.2rem;
    }

    .topbar-inner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .topbar-nav {
        top: 68px;
        max-height: calc(100vh - 80px);
        padding: 0.9rem 0.85rem 1rem;
    }

    .topbar-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: flex-start;
    }

    .logout-btn {
        width: 100%;
    }

    .finance-card {
        padding: 1.1rem;
    }

    .status-filter-btn {
        flex-basis: 100%;
    }

    .mc-id { font-size: 0.8rem; }
    .mc-hostname { font-size: 0.78rem; }
    .mc-gpu-title { font-size: 0.85rem; }
    .mc-row1 { padding-left: 1rem; padding-right: 0.75rem; }
    .mc-price { font-size: 0.78rem; padding: 0.24rem 0.55rem; }
    .mc-actions { flex-wrap: wrap; width: 100%; justify-content: flex-start; }
    .mc-actions button { flex: 1; min-width: 0; padding: 0.5rem 0.55rem; font-size: 0.72rem; }
    .mc-tag { font-size: 0.65rem; padding: 0.15rem 0.4rem; }
    .mc-row2 { grid-template-columns: repeat(2, 1fr); padding-left: 1rem; padding-right: 0.75rem; gap: 0.45rem; }
    .mc-cell { padding: 0.45rem 0.48rem; }
    .mc-cell-val { font-size: 0.75rem; }
    .mc-cell-lbl { font-size: 0.65rem; }
    .mc-row3 { padding-left: 1rem; padding-right: 0.75rem; }
    .mc-spec { white-space: normal; }

    .responsive-table tbody td {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 0.3rem;
        padding: 0.68rem 0.78rem;
    }

    .responsive-table tbody td::before {
        font-size: 0.68rem;
    }
}
