/**
 * 软件激活密钥管理系统 - 样式文件
 * Design System: Data-Dense Dashboard
 * Primary: #0891B2 | Secondary: #22D3EE | CTA: #22C55E
 */

/* ===== CSS Variables ===== */
:root {
    --primary: #0891B2;
    --primary-dark: #0E7490;
    --primary-light: #22D3EE;
    --secondary: #22D3EE;
    --cta: #22C55E;
    --cta-dark: #16A34A;
    --background: #E0F7FA;
    --background-alt: #F0F9FF;
    --surface: #FFFFFF;
    --surface-alt: #F8FAFC;
    --text: #164E63;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Status Colors */
    --status-inactive: #94A3B8;
    --status-active: #22C55E;
    --status-expired: #F59E0B;
    --status-revoked: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* Layout */
    --sidebar-width: 280px;
    --header-height: 64px;
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    min-height: 100vh;
}

/* Fira Code for code/monospace elements */
code, .mono {
    font-family: 'Fira Code', 'Consolas', monospace;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }
h5 { font-size: 0.875rem; }
h6 { font-size: 0.75rem; }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Login Page ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--background) 0%, var(--background-alt) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo svg {
    width: 32px;
    height: 32px;
    color: white;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Content Area */
.content-area {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo svg {
    width: 24px;
    height: 24px;
    color: white;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

/* Stats Cards in Sidebar */
.sidebar-stats {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.stats-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-card {
    background: var(--surface-alt);
    border-radius: var(--border-radius);
    padding: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    background: var(--background);
    transform: translateY(-1px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-card.total .stat-value { color: var(--primary); }
.stat-card.active .stat-value { color: var(--status-active); }
.stat-card.inactive .stat-value { color: var(--status-inactive); }
.stat-card.expired .stat-value { color: var(--status-expired); }

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* User Info */
.sidebar-user-top {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-logout {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: var(--surface-alt);
    color: var(--error);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--background);
}

/* Header */
.main-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Dashboard Page ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.dashboard-stat-card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    min-width: 0;
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dashboard-stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dashboard-stat-card .stat-icon svg {
    width: 28px;
    height: 28px;
}

.dashboard-stat-card.total .stat-icon {
    background: rgba(8, 145, 178, 0.1);
    color: var(--primary);
}

.dashboard-stat-card.active .stat-icon {
    background: rgba(34, 197, 94, 0.1);
    color: var(--status-active);
}

.dashboard-stat-card.inactive .stat-icon {
    background: rgba(148, 163, 184, 0.15);
    color: var(--status-inactive);
}

.dashboard-stat-card.expired .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--status-expired);
}

.dashboard-stat-card.revoked .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--status-revoked);
}

.dashboard-stat-card.users .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.dashboard-stat-card.users-total .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.dashboard-stat-card.super-users .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.dashboard-stat-card.normal-users .stat-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.dashboard-stat-card .stat-content .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-stat-card.total .stat-value { color: var(--primary); }
.dashboard-stat-card.active .stat-value { color: var(--status-active); }
.dashboard-stat-card.inactive .stat-value { color: var(--status-inactive); }
.dashboard-stat-card.expired .stat-value { color: var(--status-expired); }
.dashboard-stat-card.revoked .stat-value { color: var(--status-revoked); }
.dashboard-stat-card.users .stat-value { color: #3B82F6; }
.dashboard-stat-card.users-total .stat-value { color: #3B82F6; }
.dashboard-stat-card.super-users .stat-value { color: #F59E0B; }
.dashboard-stat-card.normal-users .stat-value { color: #22C55E; }

.dashboard-stat-card .stat-content .stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Dashboard Charts */
.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-card {
    min-height: 400px;
}

.chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.echart-pie {
    width: 100%;
    max-width: 680px;
    height: 430px;
}

.dashboard-stat-card .stat-content {
    min-width: 0;
}

/* ===== Owner User Badge ===== */
.owner-user-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    line-height: 1.3;
}

.owner-user-name {
    color: var(--text);
    white-space: nowrap;
}

.owner-user-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-alt);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: var(--error);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--surface-alt);
    cursor: not-allowed;
}

/* Select */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

/* Input with Icon */
.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-group .form-control {
    padding-left: 42px;
}

/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Form Error */
.form-error {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 6px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn svg {
    width: 18px;
    height: 18px;
}

/* Button Variants */
.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-light);
}

.btn-success {
    background: var(--cta);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: var(--cta-dark);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #DC2626;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-alt);
    color: var(--text);
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-sm svg {
    width: 16px;
    height: 16px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Button Block */
.btn-block {
    width: 100%;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.table th.checkbox-cell {
    text-align: center;
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--surface-alt);
}

.table .checkbox-cell {
    width: 40px;
    text-align: center;
}

.table .checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.table .actions-cell {
    width: 120px;
    text-align: left;
}

.table .comments-cell {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Table Actions */
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

.table-action-btn {
    padding: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.table-action-btn:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.table-action-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* ===== Status Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.badge-inactive {
    background: rgba(148, 163, 184, 0.15);
    color: var(--status-inactive);
}

.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-active);
}

.badge-expired {
    background: rgba(245, 158, 11, 0.15);
    color: var(--status-expired);
}

.badge-revoked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-revoked);
}

.badge-signing-enabled {
    background: rgba(34, 197, 94, 0.15);
    color: var(--status-active);
}

.badge-signing-disabled {
    background: rgba(148, 163, 184, 0.15);
    color: var(--status-inactive);
}

.badge-signing-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--status-revoked);
}

.duration-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
    background: rgba(8, 145, 178, 0.1);
    color: var(--primary);
}

.duration-tag.trial {
    background: rgba(34, 197, 94, 0.1);
    color: var(--cta);
}

.duration-tag.month-1 {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.duration-tag.month-3 {
    background: rgba(8, 145, 178, 0.15);
    color: #0891B2;
}

.duration-tag.month-6 {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

.duration-tag.month-12 {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.duration-tag.lifetime {
    background: rgba(236, 72, 153, 0.1);
    color: #EC4899;
}

/* User Type Tags */
.user-type-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    white-space: nowrap;
}

.user-type-tag.normal {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.user-type-tag.super {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-page-info {
    padding: 0 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

/* ===== Filters Bar ===== */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.filter-search .form-control {
    padding-left: 42px;
}

.filter-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-select {
    min-width: 140px;
}

/* ===== Batch Actions Bar ===== */
.batch-actions-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
}

.batch-actions-bar.show {
    display: flex;
}

.batch-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .batch-actions-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .batch-buttons {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

.mobile-select-all-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-select-all-btn {
        display: inline-flex;
    }
}

.btn-warning {
    background-color: #F59E0B;
    border-color: #F59E0B;
    color: white;
}

.btn-warning:hover {
    background-color: #D97706;
    border-color: #D97706;
    color: white;
}

/* ===== License Key Box ===== */
.license-key-box {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.license-key-box:hover {
    background: var(--border-light);
    border-color: var(--primary);
}

.license-key-box .mono {
    font-size: 0.875rem;
    color: var(--text);
    letter-spacing: 0.5px;
}

.license-signing-panel {
    padding: 16px;
    margin: 16px 0;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--surface-alt);
}

.license-signing-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.license-signing-panel-title {
    font-weight: 600;
    color: var(--text);
}

.signing-status-message {
    min-height: 18px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.signing-public-key {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.5;
    resize: vertical;
}

.access-service-key-box {
    justify-content: flex-start;
    text-align: left;
}

.access-service-key-box .mono {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
    line-height: 1.6;
}

.key-copy-actions {
    display: flex;
    justify-content: flex-start;
    margin-top: 8px;
}

.full-key-box {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 16px;
    word-break: break-all;
    text-align: center;
}

.full-key-box code {
    font-size: 0.875rem;
    color: var(--text);
}

.full-key-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.full-key-actions.mobile-actions {
    margin-top: 16px;
    gap: 12px;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: var(--primary);
    color: var(--primary);
}

.comments-box {
    background: var(--surface-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: var(--text-muted);
    cursor: help;
}

/* ===== Generate Panel ===== */
.generate-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.generate-form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generate-result-section {
    background: var(--surface-alt);
    border-radius: var(--border-radius);
    padding: 20px;
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.result-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

.result-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.result-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
}

.result-index {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 24px;
}

.result-key {
    flex: 1;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--text);
    word-break: break-all;
}

.result-copy-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.result-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

.result-actions {
    display: flex;
    gap: 12px;
}

.result-action-btn {
    flex: 1;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 300px;
    margin: 0 auto;
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes refreshSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.refresh-spin {
    animation: refreshSpin 0.6s ease-in-out;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== Toast Messages ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn var(--transition-normal) ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text);
}

.toast-close {
    padding: 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--surface-alt);
    color: var(--text);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.modal-overlay-top {
    z-index: 1100;
}

.modal.modal-sm {
    max-width: 360px;
}

.modal {
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    font-size: 1.5rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* ===== Tooltips ===== */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px 10px;
    background: var(--text);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--border-radius);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 100;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px);
}

/* ===== Checkbox ===== */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox svg {
    width: 12px;
    height: 12px;
    color: white;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
}

.checkbox.checked svg {
    opacity: 1;
    transform: scale(1);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar {
        width: 66.67vw;
        max-width: 300px;
        height: 100vh;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
        box-shadow: var(--shadow-lg);
        z-index: 100;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-search {
        max-width: none;
        min-width: auto;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        flex: 1;
        width: 100%;
    }

    .filters-bar .filter-buttons {
        display: flex;
        gap: 12px;
        width: 100%;
    }

    .filters-bar .filter-buttons .btn {
        flex: 1;
        justify-content: center;
    }

    .batch-actions {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .generate-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .generate-form-section {
        gap: 12px;
    }

    .generate-form-section .btn-lg {
        width: 100%;
    }

    .generate-result-section {
        padding: 16px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .result-list {
        max-height: 250px;
    }

    .result-item {
        padding: 8px 10px;
        flex-wrap: wrap;
    }

    .result-index {
        min-width: 20px;
        font-size: 0.7rem;
    }

    .result-key {
        font-size: 0.7rem;
        flex: 1;
        min-width: 0;
    }

    .result-copy-btn {
        padding: 4px 6px;
        font-size: 0.7rem;
    }

    .result-actions {
        flex-direction: column;
        gap: 8px;
    }

    .result-action-btn {
        width: 100%;
    }

    .result-pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    .result-pagination .pagination-info {
        width: 100%;
        text-align: center;
    }

    .result-pagination .pagination-controls {
        width: 100%;
        justify-content: center;
    }

    .pagination {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .pagination-controls {
        justify-content: center;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-stat-card {
        padding: 16px;
    }

    .dashboard-stat-card .stat-icon {
        width: 48px;
        height: 48px;
    }

    .dashboard-stat-card .stat-icon svg {
        width: 24px;
        height: 24px;
    }

    .dashboard-stat-card .stat-content .stat-value {
        font-size: 1.5rem;
    }

    .echart-pie {
        height: 360px;
    }

    .table-container {
        overflow-x: visible;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: var(--border-radius);
        background: var(--surface);
        padding: 16px;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-light);
    }

    .table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.75rem;
        margin-right: 12px;
        flex-shrink: 0;
    }

    .table .checkbox-cell {
        width: auto;
        text-align: left;
    }

    .table .checkbox-cell::before {
        content: "选择";
    }

    .table .actions-cell {
        width: auto;
        text-align: left;
    }

    .table-actions {
        justify-content: flex-start;
    }

    .table .comments-cell {
        max-width: none;
        overflow: visible;
    }

    .table tbody td.mono {
        word-break: break-all;
    }

    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        overflow-y: auto;
    }

    .modal {
        max-height: 90vh;
        margin-top: 10px;
    }

    .modal-body {
        max-height: 65vh;
        overflow-y: auto;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .license-key-box {
        padding: 10px 12px;
    }

    .license-key-box .mono {
        font-size: 0.75rem;
    }

    .full-key-box {
        padding: 12px;
    }

    .full-key-box code {
        font-size: 0.75rem;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .modal {
        max-width: none;
        margin: 10px;
    }

    .header-left {
        gap: 8px;
    }

    .page-title {
        font-size: 1rem;
    }

    .header-actions {
        display: none;
    }

    .generate-result-section {
        padding: 12px;
    }

    .result-list {
        max-height: 200px;
    }

    .result-item {
        padding: 6px 8px;
    }

    .result-key {
        font-size: 0.65rem;
    }
}

/* ===== User Management ===== */
.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #22C55E;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.table-action-btn.success {
    color: var(--success);
}

.table-action-btn.success:hover {
    background: rgba(34, 197, 94, 0.1);
}

/* ===== Settings ===== */
.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    flex: 1;
}

.setting-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
}

.setting-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.setting-control {
    margin-left: 16px;
}

/* ===== Switch ===== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: var(--transition-normal);
    border-radius: 26px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition-normal);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background-color: var(--primary);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(22px);
}

/* ===== Form Hint ===== */
.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Utilities ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.font-medium { font-weight: 500; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cursor-pointer { cursor: pointer; }

/* ===== Settings Page ===== */
.settings-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.settings-content {
    width: 100%;
    max-width: 600px;
}

@media (max-width: 768px) {
    .settings-container {
        justify-content: center;
    }
    
    .settings-content {
        max-width: none;
    }
}

/* ===== App Footer ===== */
.app-footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
    margin-top: auto;
}

.app-footer p {
    margin: 0;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.login-footer-link {
    margin-top: 12px;
    margin-bottom: 8px;
}

.login-footer-copyright {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.login-footer-link a {
    color: var(--primary);
    font-size: 0.75rem;
    transition: color var(--transition-fast);
}

.login-footer-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Searchable Select Component ===== */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-input {
    width: 100%;
    padding: 10px 14px;
    padding-right: 36px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.searchable-select-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.searchable-select-input::placeholder {
    color: var(--text-muted);
}

.searchable-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.searchable-select.open .searchable-select-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 400px; /* 约10个选项的高度 */
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    margin-top: 4px;
    display: none;
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-option {
    padding: 10px 14px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text);
}

.searchable-select-option:hover {
    background: var(--background-alt);
}

.searchable-select-option.selected {
    background: rgba(8, 145, 178, 0.1);
    color: var(--primary);
}

.searchable-select-option.highlighted {
    background: var(--background-alt);
}

.searchable-select-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.searchable-select-clear {
    position: absolute;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: none;
}

.searchable-select.has-value .searchable-select-clear {
    display: block;
}

.searchable-select-clear:hover {
    color: var(--text-secondary);
}

.searchable-select-admin-badge {
    display: inline-block;
    font-size: 0.625rem;
    padding: 2px 6px;
    background: var(--primary);
    color: white;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .searchable-select-dropdown {
        max-height: 220px;
    }
}

/* 走势图卡片样式 */
.trend-chart-card {
    overflow: visible;
}

.trend-chart-card .card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* 周期选择标签 */
.period-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-tab {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.period-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.period-tab.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.trend-chart-wrapper {
    position: relative;
    width: 100%;
    height: 320px;
}

.trend-chart-wrapper.combined {
    margin-top: 4px;
}

.echart-line {
    width: 100%;
    height: 100%;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .period-tabs {
        width: 100%;
        justify-content: center;
    }

    .period-tab {
        padding: 5px 12px;
        font-size: 12px;
    }

    .echart-pie {
        height: 300px;
    }

    .trend-chart-wrapper {
        height: 260px;
    }
}

/* 板块分隔线 */
.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px 0;
}

.section-divider .divider-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--border) 80%, transparent 100%);
}

/* ===== Force Change Password Modal ===== */
.force-password-notice {
    text-align: center;
    padding: 20px 0;
}

.force-password-notice .notice-icon {
    margin-bottom: 16px;
}

.force-password-notice .notice-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== License Limit Modal ===== */
.license-limit-notice {
    text-align: center;
    padding: 20px 0;
}

.license-limit-notice .notice-icon {
    margin-bottom: 16px;
}

.license-limit-notice .notice-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== License Limit Alert (可关闭的警告) ===== */
.license-limit-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    border: 1px solid #90CAF9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.license-limit-alert .alert-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.license-limit-alert .alert-icon {
    width: 20px;
    height: 20px;
    color: #1976D2;
    flex-shrink: 0;
}

.license-limit-alert .alert-message {
    font-size: 14px;
    color: #1565C0;
    line-height: 1.5;
}

.license-limit-alert .alert-close-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1976D2;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #1976D2;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.license-limit-alert .alert-close-btn:hover {
    background: #1976D2;
    color: #fff;
}

.license-limit-alert .alert-close-btn:active {
    transform: scale(0.98);
}

/* ===== 绑定设备自定义列表 ===== */
.bound-device-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bound-device-item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: var(--surface-color, #f9fafb);
}

.bound-device-remove {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bound-device-remove:hover {
    background: #fecaca;
}

.bound-device-code {
    overflow-wrap: anywhere;
    word-break: break-all;
    font-size: 13px;
}
