/* ==========================================
   浜戠瀛樻。淇濇姢鍣?- 涓绘牱寮忚〃
   Cloud Save Protector - Main Stylesheet
   ========================================== */

/* ============ CSS 鍙橀噺 ============ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a28;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(255, 255, 255, 0.12);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.35);

    --accent-blue: #00d4ff;
    --accent-purple: #7b2fff;
    --accent-green: #00e676;
    --accent-orange: #ff9100;
    --accent-red: #ff3d5a;
    --accent-pink: #ff4081;

    --gradient-primary: linear-gradient(135deg, #00d4ff, #7b2fff);
    --gradient-card: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(123, 47, 255, 0.05));
    --gradient-glow: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.1);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 240px;
    --topbar-height: 64px;

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ============ 鍏ㄥ眬閲嶇疆 ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    line-height: 1.5;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #33dcff;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    outline: none;
}

/* ============ 绮掑瓙鑳屾櫙鐢诲竷 ============ */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

.bg-glow-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-blue);
    top: -150px;
    right: -100px;
}

.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-purple);
    bottom: -100px;
    left: -100px;
}

/* ============ 搴旂敤瀹瑰櫒 ============ */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100vh;
}

/* ============ 椤甸潰鍒囨崲 ============ */
.page {
    display: none;
    width: 100%;
    height: 100vh;
}

.page.active {
    display: flex;
}

/* ==========================================
   鐧诲綍椤甸潰
   ========================================== */
.page-login {
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.login-wrapper {
    width: 420px;
    max-width: 94vw;
    position: relative;
    z-index: 2;
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
}

.login-title {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.title-char {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b9d, #c44dff, #6c63ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleFloat 3s ease-in-out infinite;
}

.title-char:nth-child(1) { animation-delay: 0s; }
.title-char:nth-child(2) { animation-delay: 0.15s; }
.title-char:nth-child(3) { animation-delay: 0.3s; }

@keyframes titleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.login-subtitle {
    font-size: 0.82rem;
    color: #888;
    letter-spacing: 3px;
    margin-bottom: 0;
}

/* Shine button effect */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

/* Third glow */
.bg-glow-3 {
    top: auto;
    bottom: -150px;
    right: 20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.12) 0%, transparent 70%);
    animation: glowPulse 6s ease-in-out infinite;
    animation-delay: 2s;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Card hover effects */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(108, 99, 255, 0.12);
    border-color: rgba(108, 99, 255, 0.2);
}

.stat-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon {
    transition: transform 0.3s ease;
}

/* Table row animation */
.file-table tbody tr {
    transition: background 0.2s ease;
}

.file-table tbody tr:hover {
    background: rgba(108, 99, 255, 0.06);
}

/* Sidebar active indicator glow */
.nav-item.active {
    background: linear-gradient(90deg, rgba(108, 99, 255, 0.2), transparent);
    border-right: 2px solid #6c63ff;
    box-shadow: inset 0 0 12px rgba(108, 99, 255, 0.05);
}

/* Download card hover */
.download-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(108, 99, 255, 0.15);
    border-color: rgba(108, 99, 255, 0.3);
}

/* Input focus glow */
.input-field:focus {
    border-color: #6c63ff;
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.15), inset 0 0 8px rgba(108, 99, 255, 0.05);
}

/* Toast slide-in */
@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Page transition */
.content-page {
    animation: pageIn 0.4s ease;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'Consolas', 'Courier New', monospace;
}

.login-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.input-field {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.input-field:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

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

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.eye-icon {
    width: 18px;
    height: 18px;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-active);
    border-radius: 4px;
    margin-right: 8px;
    transition: all var(--transition-fast);
    position: relative;
    flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 5px;
    width: 5px;
    height: 8px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.forgot-link {
    font-size: 0.8rem;
}

.btn-login {
    width: 100%;
    padding: 13px;
    background: var(--gradient-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 3px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.3);
}

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

.btn-login.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-login.loading .btn-text {
    visibility: hidden;
}

.btn-login.loading .btn-loader {
    display: flex;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 22px;
    height: 22px;
    animation: spin 1s linear infinite;
}

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

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.footer-register {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-register a {
    font-weight: 500;
}

/* ==========================================
   浠〃鏉夸富浣撳竷灞€
   ========================================== */
.page-dashboard {
    flex-direction: row;
}

/* ============ 渚ц竟鏍?============ */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo svg {
    width: 32px;
    height: 32px;
    color: var(--accent-blue);
}

.sidebar-title {
    font-family: 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-normal);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-logout {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-logout svg {
    width: 18px;
    height: 18px;
}

.btn-logout:hover {
    background: rgba(255, 61, 90, 0.1);
    color: var(--accent-red);
}

/* ============ 涓诲唴瀹瑰尯 ============ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-primary);
}

.topbar {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    gap: 16px;
}

.btn-menu-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    align-items: center;
    justify-content: center;
}

.btn-menu-toggle svg {
    width: 20px;
    height: 20px;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 600;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-bell {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.notification-bell svg {
    width: 18px;
    height: 18px;
}

.notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-red);
    border: 2px solid var(--bg-secondary);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
}

.content-scroll::-webkit-scrollbar {
    width: 5px;
}

.content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.content-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============ 鍐呭椤甸潰 ============ */
.content-page {
    display: none;
    animation: fadeSlideIn 0.35s ease;
}

.content-page.active {
    display: block;
}

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

/* ============ 缁熻鍗＄墖 ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-active);
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon-blue {
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent-blue);
}

.stat-icon-purple {
    background: rgba(123, 47, 255, 0.1);
    color: var(--accent-purple);
}

.stat-icon-green {
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-green);
}

.stat-icon-orange {
    background: rgba(255, 145, 0, 0.1);
    color: var(--accent-orange);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 1px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ 浠〃鏉跨綉鏍?============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ============ 鍗＄墖 ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-link {
    font-size: 0.8rem;
    font-weight: 500;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============ 瀛樺偍绌洪棿鍦嗙幆 ============ */
.storage-card {
    padding-bottom: 24px;
    display: flex;
    flex-direction: column;
}

.storage-ring-container {
    display: flex;
    justify-content: center;
    padding: 24px 0 16px;
}

.storage-ring {
    width: 180px;
    height: 180px;
}

.storage-details {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 0 24px;
}

.storage-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.detail-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.detail-value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.75rem;
}

/* ============ 鏈€杩戞枃浠跺垪琛?============ */
.recent-card {
    padding-bottom: 16px;
}

.recent-list {
    padding: 16px 24px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.recent-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recent-item-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ============ 绌虹姸鎬?============ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.85rem;
}

.empty-state span {
    font-size: 0.75rem;
    margin-top: 4px;
}

.empty-state.full-width {
    grid-column: 1 / -1;
    padding: 60px 20px;
}

/* ============ 鎼滅储妗?============ */
.search-box {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    padding: 8px 12px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.82rem;
    width: 200px;
    transition: all var(--transition-normal);
}

.search-input:focus {
    border-color: var(--accent-blue);
    width: 260px;
}

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

/* ============ 鎸夐挳 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.25);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(255, 61, 90, 0.15);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(255, 61, 90, 0.25);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* ============ 鏂囦欢琛ㄦ牸 ============ */
.table-wrapper {
    overflow-x: auto;
}

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

.file-table th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.file-table td {
    padding: 14px 20px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.file-table tbody tr {
    transition: all var(--transition-fast);
}

.file-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

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

.file-table .empty-row td {
    padding: 0;
    border: none;
}

.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.file-type-icon svg {
    width: 16px;
    height: 16px;
}

.file-type-icon.zip {
    background: rgba(255, 145, 0, 0.1);
    color: var(--accent-orange);
}

.file-type-icon.image {
    background: rgba(0, 230, 118, 0.1);
    color: var(--accent-green);
}

.file-size {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.file-actions {
    display: flex;
    gap: 4px;
}

/* ============ 涓嬭浇涓績缃戞牸 ============ */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px 24px 24px;
}

.download-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.download-card:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
    transform: translateY(-2px);
}

.download-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.download-card-icon svg {
    width: 24px;
    height: 24px;
}

.download-card-name {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-card-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Courier New', monospace;
}

.download-card-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.download-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* ============ 涓婁紶鍖哄煙 ============ */
.upload-card {
    margin-bottom: 20px;
}

.upload-area {
    padding: 24px;
}

.upload-zone {
    border: 2px dashed var(--border-active);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(0, 212, 255, 0.03);
}

.upload-icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon-wrapper svg {
    width: 28px;
    height: 28px;
}

.upload-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.upload-link {
    color: var(--accent-blue);
    font-weight: 500;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 涓婁紶棰勮 */
.upload-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.08);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.preview-icon svg {
    width: 20px;
    height: 20px;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.preview-name {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Consolas', 'Courier New', monospace;
    margin-top: 2px;
}

/* 涓婁紶杩涘害鏉?*/
.upload-progress {
    padding: 8px 0;
}

.progress-bar-wrapper {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: 'Consolas', 'Courier New', monospace;
}

/* ============ 涓婁紶椤荤煡 ============ */
.upload-tips {
    margin-bottom: 0;
}

.tips-list {
    list-style: none;
    padding: 0 24px 20px;
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.tips-list li svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================
   Toast 閫氱煡
   ========================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: all;
    min-width: 280px;
    max-width: 400px;
}

.toast.success {
    border-left: 3px solid var(--accent-green);
}

.toast.error {
    border-left: 3px solid var(--accent-red);
}

.toast.warning {
    border-left: 3px solid var(--accent-orange);
}

.toast.info {
    border-left: 3px solid var(--accent-blue);
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--accent-green); }
.toast.error .toast-icon { color: var(--accent-red); }
.toast.warning .toast-icon { color: var(--accent-orange); }
.toast.info .toast-icon { color: var(--accent-blue); }

.toast-message {
    font-size: 0.85rem;
    flex: 1;
}

.toast-close {
    background: none;
    color: var(--text-muted);
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.removing {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ==========================================
   妯℃€佸脊绐?   ========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 92vw;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

#modalTitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-body {
    padding: 16px 24px;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-body p {
    margin: 0;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==========================================
   鍝嶅簲寮忚璁?   ========================================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .download-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .btn-menu-toggle {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    .search-input:focus {
        width: 100%;
    }

    .content-scroll {
        padding: 16px;
    }

    .file-table th:nth-child(3),
    .file-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        width: 100%;
    }

    .login-form {
        padding: 24px 20px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ Backup Type Badges ============ */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-daily {
    background: rgba(106, 90, 255, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
}

.badge-hourly {
    background: rgba(0, 212, 255, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-other {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ============ Section Headers ============ */
.section-header td {
    background: rgba(106, 90, 255, 0.08) !important;
    color: #a78bfa !important;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 16px !important;
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
}

.section-title {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #a78bfa;
    padding: 8px 0 4px;
    margin-top: 12px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.15);
}

/* ============ Tier Badges & Panel ============ */
.tier-badge {
    padding: 2px 10px; border-radius: 6px;
    font-size: 0.7rem; font-weight: 600; letter-spacing: 0.3px;
    border: none;
}
.tier-standard { background: rgba(148,163,184,0.1); color: #94a3b8; }
.tier-advanced { background: rgba(56,189,248,0.1); color: #38bdf8; }
.tier-super    { background: rgba(196,77,255,0.1); color: #c44dff; }
.tier-admin    { background: rgba(108,99,255,0.1); color: #6c63ff; }

.tier-label { font-weight: 700; }
.tier-label.tier-standard { color: #94a3b8; }
.tier-label.tier-advanced { color: #38bdf8; }
.tier-label.tier-super    { color: #c44dff; }

.tier-detail { font-size: 0.75rem; color: #94a3b8; }

.stat-icon-gold { background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(255,107,157,0.1)); color: var(--gold); }

/* ============ Tier Modal ============ */
.tier-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
    z-index: 200; display: flex; align-items: center; justify-content: center;
    animation: fadeIn 0.2s ease;
}
.tier-modal {
    background: #12122a; border: 1px solid #1e1e40; border-radius: 14px;
    width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: scaleIn 0.25s ease;
}
.tier-modal-hdr {
    padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center;
    font-size: 1rem; font-weight: 600; color: #e0e0e0;
}
.tier-modal-close {
    background: none; border: none; color: #666; font-size: 1.4rem; cursor: pointer;
    width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.tier-modal-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.tier-modal-body { padding: 12px 22px; }
.tier-modal-ftr { padding: 0 22px 18px; display: flex; justify-content: flex-end; }

/* ============ Tier Compare ============ */
.tier-compare { display: flex; gap: 10px; padding: 0 6px 12px; }
.tier-col {
    flex: 1; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 18px 10px 14px; text-align: center; position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.tier-col:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.tier-col-active { border-color: var(--accent); background: linear-gradient(180deg, rgba(108,99,255,0.06), rgba(108,99,255,0.02)); }
.tier-current-tag {
    position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
    background: var(--accent); color: #fff; font-size: 0.58rem; padding: 3px 12px; border-radius: 10px; font-weight: 700;
    letter-spacing: 0.5px;
}
.tier-col-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); margin: 6px 0 10px; }
.tier-col-storage { font-size: 1.5rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.tier-col-item { font-size: 0.68rem; color: var(--text-muted); line-height: 2; }
.tier-col-item strong { color: var(--text-primary); }
.tier-switch-btn { margin-top: 12px; width: 100%; font-size: 0.68rem; padding: 6px 0; }
.tier-upgrade-msg {
    text-align: center; padding: 10px 6px 4px; font-size: 0.68rem; color: var(--text-muted);
    border-top: 1px solid var(--border-color); opacity: 0.8;
}

/* ============ Sidebar ============ */
#statTierCard { transition: transform 0.3s ease, box-shadow 0.3s ease; }
#statTierCard:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(251,191,36,0.12); }
.storage-warning { display: flex; align-items: center; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:0.7} 50%{opacity:1} }

