/* ============================================
   iOS Style Cloud Drive - Cold Tone Pure White
   Dark Mode: Black Gold Flowing Style
   ============================================ */

/* CSS Variables */
:root {
    /* Light Mode - iOS Cold Tone Pure White */
    --bg-primary: #f2f5f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.72);
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: rgba(209, 213, 219, 0.5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-slate: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --navbar-bg: rgba(255, 255, 255, 0.78);
    --navbar-border: rgba(209, 213, 219, 0.4);
    --table-header-bg: rgba(241, 245, 249, 0.8);
    --table-hover: rgba(59, 130, 246, 0.04);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(209, 213, 219, 0.6);
    --progress-bg: rgba(59, 130, 246, 0.1);
    --progress-fill: linear-gradient(135deg, #3b82f6, #06b6d4);
    --gold-text: none;
    --gold-bg: none;
}

/* Dark Mode - Black Gold Flowing */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 30, 0.88);
    --bg-glass: rgba(20, 20, 30, 0.72);
    --text-primary: #e8d5a3;
    --text-secondary: #c9b16a;
    --text-muted: #8a7a4a;
    --border-color: rgba(200, 170, 80, 0.15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --accent-blue: #d4af37;
    --accent-cyan: #f0c674;
    --accent-slate: #b8973d;
    --success: #98c379;
    --warning: #e5c07b;
    --danger: #e06c75;
    --navbar-bg: rgba(10, 10, 15, 0.85);
    --navbar-border: rgba(212, 175, 55, 0.15);
    --table-header-bg: rgba(212, 175, 55, 0.08);
    --table-hover: rgba(212, 175, 55, 0.06);
    --input-bg: rgba(20, 20, 30, 0.9);
    --input-border: rgba(212, 175, 55, 0.2);
    --progress-bg: rgba(212, 175, 55, 0.1);
    --progress-fill: linear-gradient(135deg, #d4af37, #f0c674, #d4af37);
    --gold-text: linear-gradient(90deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    --gold-bg: linear-gradient(135deg, #1a1510, #0f0c08);
}

/* Global Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
    font-size: 15px;
    letter-spacing: 0.01em;
}

/* ============================================
   Dark Mode Text Handling - Safe & Visible
   ============================================ */

/* Gold Gradient Animation Keyframes */
@keyframes goldFlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* ONLY decorative headings get gold gradient effect */
[data-theme="dark"] .ios-page-header h2,
[data-theme="dark"] .ios-login-card .logo-area h2 {
    background: var(--gold-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 200% auto;
    animation: goldFlow 4s linear infinite;
}

/* Global dark mode base text - always visible solid gold */
[data-theme="dark"] body {
    color: var(--text-primary);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--text-primary);
}

/* Navigation - always visible */
[data-theme="dark"] .navbar-brand {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .nav-link {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

[data-theme="dark"] .nav-link.active {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .nav-link:hover {
    color: #f0c674;
    -webkit-text-fill-color: #f0c674;
}

/* Card headers */
[data-theme="dark"] .ios-card-header h3 {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
}

/* Subtitles and muted text */
[data-theme="dark"] .subtitle,
[data-theme="dark"] .text-muted {
    color: #8a7a4a;
    -webkit-text-fill-color: #8a7a4a;
}

[data-theme="dark"] .text-secondary {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Table cells - always visible */
[data-theme="dark"] .ios-table tbody td {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
}

[data-theme="dark"] .ios-table thead th {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Form labels */
[data-theme="dark"] .ios-form-label {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Tabs */
[data-theme="dark"] .ios-tabs li a {
    color: #8a7a4a;
    -webkit-text-fill-color: #8a7a4a;
}

[data-theme="dark"] .ios-tabs li.active a {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .ios-tabs li a:hover {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Alerts */
[data-theme="dark"] .ios-alert {
    color: inherit;
    -webkit-text-fill-color: inherit;
}

[data-theme="dark"] .ios-alert-info {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .ios-alert-success {
    color: #98c379;
    -webkit-text-fill-color: #98c379;
}

[data-theme="dark"] .ios-alert-warning {
    color: #e5c07b;
    -webkit-text-fill-color: #e5c07b;
}

[data-theme="dark"] .ios-alert-danger {
    color: #e06c75;
    -webkit-text-fill-color: #e06c75;
}

/* Pagination */
[data-theme="dark"] .ios-pagination li a {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

[data-theme="dark"] .ios-pagination li a:hover {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .ios-pagination li.active span,
[data-theme="dark"] .ios-pagination li.disabled span {
    color: #8a7a4a;
    -webkit-text-fill-color: #8a7a4a;
}

/* Upload area */
[data-theme="dark"] .ios-upload-area h3 {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
}

[data-theme="dark"] .ios-upload-area p {
    color: #8a7a4a;
    -webkit-text-fill-color: #8a7a4a;
}

/* File icon */
[data-theme="dark"] .ios-file-icon p {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
}

/* Checkbox & Radio text */
[data-theme="dark"] .ios-checkbox span,
[data-theme="dark"] .ios-radio span {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Inputs - always visible */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-control {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
    background: var(--input-bg);
}

[data-theme="dark"] select {
    color: #e8d5a3;
    background: var(--input-bg);
}

[data-theme="dark"] ::placeholder {
    color: #8a7a4a;
    opacity: 0.7;
}

/* Buttons - always visible with solid colors */
[data-theme="dark"] .ios-btn-primary {
    color: #0a0a0f;
    -webkit-text-fill-color: #0a0a0f;
}

[data-theme="dark"] .ios-btn-secondary {
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .ios-btn-danger {
    color: #fff;
    -webkit-text-fill-color: #fff;
}

/* Social login buttons */
[data-theme="dark"] .ios-social-btn.qq,
[data-theme="dark"] .ios-social-btn.wx {
    color: #fff;
    -webkit-text-fill-color: #fff;
}

[data-theme="dark"] .ios-social-btn {
    color: #e8d5a3;
    -webkit-text-fill-color: #e8d5a3;
}

/* Progress bar text */
[data-theme="dark"] .ios-progress + div span,
[data-theme="dark"] .ios-progress ~ div span {
    color: #c9b16a;
    -webkit-text-fill-color: #c9b16a;
}

/* Scrollbar iOS Style */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Navigation Bar - iOS Style
   ============================================ */
.navbar-ios {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    padding: 0 24px;
    transition: var(--transition);
}

.navbar-ios .navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.navbar-ios .navbar-brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-ios .navbar-brand i {
    font-size: 24px;
    color: var(--accent-blue);
}

.navbar-ios .nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.navbar-ios .nav-item {
    position: relative;
}

.navbar-ios .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-secondary);
}

.navbar-ios .nav-link:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.navbar-ios .nav-link.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    font-weight: 600;
}

[data-theme="dark"] .navbar-ios .nav-link:hover {
    background: rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .navbar-ios .nav-link.active {
    background: rgba(212, 175, 55, 0.15);
}

/* Theme Toggle Button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    transform: scale(1.08) rotate(15deg);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-toggle {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(20, 20, 30, 0.8);
    color: #d4af37;
}

/* Mobile Menu Toggle */
.navbar-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.navbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   Container & Layout
   ============================================ */
.ios-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.ios-page-header {
    margin-bottom: 28px;
}

.ios-page-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.8px;
    margin-bottom: 8px;
}

.ios-page-header .subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Cards - iOS Glassmorphism
   ============================================ */
.ios-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.ios-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.ios-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ios-card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.ios-card-body {
    padding: 24px;
}

/* ============================================
   Tables - iOS Style
   ============================================ */
.ios-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.ios-table thead th {
    background: var(--table-header-bg);
    padding: 14px 18px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.ios-table thead th:first-child {
    border-radius: var(--radius-sm) 0 0 0;
}

.ios-table thead th:last-child {
    border-radius: 0 var(--radius-sm) 0 0;
}

.ios-table tbody tr {
    transition: var(--transition);
}

.ios-table tbody tr:hover {
    background: var(--table-hover);
}

.ios-table tbody td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.ios-table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 var(--radius-sm);
}

.ios-table tbody tr:last-child td:last-child {
    border-radius: 0 0 var(--radius-sm) 0;
}

/* Empty State */
.ios-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.ios-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ============================================
   Buttons - iOS Style
   ============================================ */
.ios-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.ios-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.ios-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.ios-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.ios-btn-secondary:hover {
    background: var(--table-hover);
}

.ios-btn-danger {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.ios-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 10px;
}

.ios-btn-lg {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* Dark mode buttons */
[data-theme="dark"] .ios-btn-primary {
    background: linear-gradient(135deg, #d4af37, #f0c674);
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    color: #0a0a0f;
}

[data-theme="dark"] .ios-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

[data-theme="dark"] .ios-btn-secondary {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

[data-theme="dark"] .ios-btn-danger {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.3);
    -webkit-text-fill-color: #fff;
    color: #fff;
}

/* ============================================
   Forms & Inputs - iOS Style
   ============================================ */
.ios-form-group {
    margin-bottom: 20px;
}

.ios-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.ios-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.ios-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ios-input-group {
    display: flex;
    gap: 0;
}

.ios-input-group .ios-input {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    flex: 1;
}

.ios-input-group .ios-btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Checkbox iOS Style */
.ios-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.ios-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.ios-checkbox input[type="checkbox"]:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.ios-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

[data-theme="dark"] .ios-checkbox input[type="checkbox"]:checked {
    background: #d4af37;
    border-color: #d4af37;
}

/* Radio iOS Style */
.ios-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.ios-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.ios-radio input[type="radio"]:checked {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
}

.ios-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

[data-theme="dark"] .ios-radio input[type="radio"]:checked {
    border-color: #d4af37;
    background: #d4af37;
}

/* ============================================
   Pagination - iOS Style
   ============================================ */
.ios-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ios-pagination li a,
.ios-pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.ios-pagination li a:hover {
    background: var(--table-hover);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.ios-pagination li.active span,
.ios-pagination li.disabled span {
    background: var(--table-header-bg);
    color: var(--text-muted);
    border-color: var(--border-color);
    cursor: default;
    -webkit-text-fill-color: var(--text-muted);
}

[data-theme="dark"] .ios-pagination li a:hover {
    border-color: #d4af37;
    color: #d4af37;
    -webkit-text-fill-color: #d4af37;
}

/* ============================================
   Upload Area - iOS Style
   ============================================ */
.ios-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background: var(--bg-glass);
    position: relative;
    overflow: hidden;
}

.ios-upload-area:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.03);
}

.ios-upload-area.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.06);
    transform: scale(1.01);
}

.ios-upload-area i {
    font-size: 56px;
    color: var(--accent-blue);
    opacity: 0.7;
    margin-bottom: 16px;
}

.ios-upload-area h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ios-upload-area p {
    color: var(--text-muted);
    font-size: 14px;
}

[data-theme="dark"] .ios-upload-area:hover {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

[data-theme="dark"] .ios-upload-area i {
    color: #d4af37;
}

/* Progress Bar */
.ios-progress {
    width: 100%;
    height: 8px;
    background: var(--progress-bg);
    border-radius: 100px;
    overflow: hidden;
    margin: 16px 0;
}

.ios-progress-bar {
    height: 100%;
    background: var(--progress-fill);
    border-radius: 100px;
    transition: width 0.3s ease;
    position: relative;
}

.ios-progress-bar::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 0 100px 100px 0;
}

/* ============================================
   File View Page - iOS Style
   ============================================ */
.ios-file-preview {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
}

.ios-file-icon {
    text-align: center;
    padding: 40px;
}

.ios-file-icon i {
    font-size: 80px;
    color: var(--accent-blue);
    opacity: 0.8;
    margin-bottom: 20px;
}

[data-theme="dark"] .ios-file-icon i {
    color: #d4af37;
}

/* Flat buttons inside file preview */
.ios-file-icon .ios-btn,
.ios-file-icon .ios-btn-sm {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    box-shadow: none;
    font-weight: 500;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    line-height: 1.4;
}

.ios-file-icon .ios-btn:hover,
.ios-file-icon .ios-btn-sm:hover {
    background: var(--table-hover);
    transform: none;
    box-shadow: none;
}

.ios-file-icon .ios-btn-primary,
.ios-file-icon .ios-btn-primary.ios-btn-sm {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

[data-theme="dark"] .ios-file-icon .ios-btn-primary,
[data-theme="dark"] .ios-file-icon .ios-btn-primary.ios-btn-sm {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
    color: #d4af37;
    box-shadow: none;
}

[data-theme="dark"] .ios-file-icon .ios-btn-primary:hover,
[data-theme="dark"] .ios-file-icon .ios-btn-primary.ios-btn-sm:hover {
    background: rgba(212, 175, 55, 0.15);
    box-shadow: none;
}

.ios-file-icon .ios-btn-secondary,
.ios-file-icon .ios-btn-secondary.ios-btn-sm {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.ios-file-icon .ios-btn-secondary:hover,
.ios-file-icon .ios-btn-secondary.ios-btn-sm:hover {
    background: var(--table-hover);
}

.ios-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    list-style: none;
    margin: 0;
}

.ios-tabs li {
    position: relative;
}

.ios-tabs li a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.ios-tabs li a:hover {
    color: var(--text-secondary);
}

.ios-tabs li.active a {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

[data-theme="dark"] .ios-tabs li.active a {
    color: #d4af37;
    border-bottom-color: #d4af37;
}

.ios-tab-content {
    padding: 24px;
}

.ios-tab-pane {
    display: none;
}

.ios-tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ============================================
   Login Page - iOS Style
   ============================================ */
.ios-login-card {
    max-width: 400px;
    margin: 80px auto;
    text-align: center;
}

.ios-login-card .logo-area {
    margin-bottom: 32px;
}

.ios-login-card .logo-area i {
    font-size: 64px;
    color: var(--accent-blue);
    margin-bottom: 16px;
}

[data-theme="dark"] .ios-login-card .logo-area i {
    color: #d4af37;
}

.ios-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 12px;
}

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

.ios-social-btn.qq {
    background: linear-gradient(135deg, #12b7f5, #0a9ad8);
    color: white;
    border: none;
    -webkit-text-fill-color: #fff;
}

.ios-social-btn.wx {
    background: linear-gradient(135deg, #07c160, #05a350);
    color: white;
    border: none;
    -webkit-text-fill-color: #fff;
}

/* ============================================
   Alert / Info Boxes
   ============================================ */
.ios-alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.ios-alert-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.ios-alert-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.ios-alert-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.ios-alert-danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

[data-theme="dark"] .ios-alert-info {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.2);
    color: #d4af37;
}

/* ============================================
   Grid System
   ============================================ */
.ios-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.ios-col {
    padding: 0 12px;
    flex: 1;
}

.ios-col-3 { flex: 0 0 25%; max-width: 25%; }
.ios-col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.ios-col-6 { flex: 0 0 50%; max-width: 50%; }
.ios-col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.ios-col-9 { flex: 0 0 75%; max-width: 75%; }
.ios-col-12 { flex: 0 0 100%; max-width: 100%; }

/* ============================================
   Utilities
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 992px) {
    .ios-col-md-3,
    .ios-col-md-4,
    .ios-col-md-6,
    .ios-col-md-8,
    .ios-col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 16px;
    }
    
    .ios-col-md-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .navbar-ios .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--navbar-bg);
        backdrop-filter: blur(24px);
        border-bottom: 1px solid var(--navbar-border);
        flex-direction: column;
        padding: 12px 24px;
        gap: 4px;
    }
    
    .navbar-ios .nav-menu.open {
        display: flex;
    }
    
    .navbar-ios .nav-link {
        width: 100%;
        justify-content: flex-start;
    }
    
    .navbar-toggle {
        display: flex;
    }
    
    .ios-container {
        padding: 16px;
    }
    
    .ios-page-header h2 {
        font-size: 22px;
    }
    
    .ios-col-1, .ios-col-2, .ios-col-3, .ios-col-4,
    .ios-col-5, .ios-col-6, .ios-col-7, .ios-col-8,
    .ios-col-9, .ios-col-10, .ios-col-11, .ios-col-12,
    .ios-col-sm-1, .ios-col-sm-2, .ios-col-sm-3, .ios-col-sm-4,
    .ios-col-sm-5, .ios-col-sm-6, .ios-col-sm-7, .ios-col-sm-8,
    .ios-col-sm-9, .ios-col-sm-10, .ios-col-sm-11, .ios-col-sm-12,
    .ios-col-md-1, .ios-col-md-2, .ios-col-md-3, .ios-col-md-4,
    .ios-col-md-5, .ios-col-md-6, .ios-col-md-7, .ios-col-md-8,
    .ios-col-md-9, .ios-col-md-10, .ios-col-md-11, .ios-col-md-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .ios-table {
        font-size: 13px;
    }
    
    .ios-table thead th,
    .ios-table tbody td {
        padding: 10px 12px;
    }
    
    .ios-pagination {
        justify-content: center;
    }
}

[data-theme="dark"] ::placeholder {
    color: #8a7a4a;
    opacity: 0.7;
}

[data-theme="dark"] .ios-tabs li a {
    -webkit-text-fill-color: var(--text-muted);
}

[data-theme="dark"] .ios-tabs li.active a {
    -webkit-text-fill-color: #d4af37;
}

/* ============================================
   Dark Mode Specific Gold Effects
   ============================================ */
[data-theme="dark"] .ios-card {
    background: var(--bg-card);
    border-color: rgba(212, 175, 55, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(212, 175, 55, 0.05);
}

[data-theme="dark"] .ios-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.15);
}

[data-theme="dark"] body {
    background: var(--gold-bg);
}

/* Shine effect for dark mode cards */
[data-theme="dark"] .ios-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.03), transparent);
    transition: left 0.7s ease;
    pointer-events: none;
}

[data-theme="dark"] .ios-card:hover::before {
    left: 100%;
}

/* QR Code styling in dark mode */
[data-theme="dark"] .ios-qr img {
    border-radius: var(--radius-sm);
    padding: 8px;
    background: white;
}

/* ============================================
   File List - Desktop Table / Mobile Card Switch
   ============================================ */
.file-table-wrap { display: block !important; }
.file-card-wrap { display: none !important; }

@media (max-width: 768px) {
    .file-table-wrap { display: none !important; }
    .file-card-wrap { display: block !important; }
}

/* ============================================
   Mobile File Card List
   ============================================ */
.file-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.file-card:last-child {
    border-bottom: none;
}

.file-card:hover {
    background: var(--table-hover);
}

.file-card-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.file-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(6,182,212,0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: var(--accent-blue);
}

[data-theme="dark"] .file-card-icon {
    background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05));
    color: #d4af37;
}

.file-card-info {
    flex: 1;
    min-width: 0;
}

.file-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    word-break: break-all;
    line-height: 1.4;
}

.file-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.file-card-actions {
    display: flex;
    gap: 8px;
    padding-left: 58px;
}

/* ============================================
   Mobile Responsive Overrides
   ============================================ */
@media (max-width: 768px) {
    .file-table-wrap { display: none; }
    .file-card-wrap { display: block; }
    
    .navbar-ios .navbar-brand {
        font-size: 17px;
    }
    
    .navbar-ios .navbar-brand i {
        font-size: 20px;
    }
    
    .ios-page-header {
        margin-bottom: 20px;
    }
    
    .ios-page-header h2 {
        font-size: 20px;
    }
    
    .ios-card-header {
        padding: 16px 18px;
    }
    
    .ios-card-header h3 {
        font-size: 16px;
    }
    
    .ios-card-body {
        padding: 16px;
    }
    
    .file-card {
        padding: 14px 16px;
    }
    
    .file-card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .file-card-actions {
        padding-left: 54px;
    }
    
    .ios-upload-area {
        padding: 40px 20px;
    }
    
    .ios-upload-area i {
        font-size: 40px;
    }
    
    .ios-upload-area h3 {
        font-size: 18px;
    }
    
    /* Mobile pagination compact */
    .ios-pagination li a,
    .ios-pagination li span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 12px;
    }
    
    /* Mobile login card */
    .ios-login-card {
        margin: 40px auto;
        padding: 0 16px;
    }
    
    /* Mobile file view */
    .ios-file-preview {
        min-height: 200px;
    }
    
    .ios-file-icon i {
        font-size: 56px;
    }
    
    .ios-tabs {
        padding: 0 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .ios-tabs li a {
        padding: 12px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .ios-tab-content {
        padding: 16px;
    }
    
    /* Mobile input groups */
    .ios-input-group {
        flex-direction: column;
    }
    
    .ios-input-group .ios-input {
        border-radius: var(--radius-sm);
        margin-bottom: 8px;
    }
    
    .ios-input-group .ios-btn {
        border-radius: var(--radius-sm);
    }
    
    /* Mobile QR */
    .ios-qr img {
        max-width: 140px;
    }
}

/* ============================================
   Small Phone Optimizations (< 480px)
   ============================================ */
@media (max-width: 480px) {
    .ios-container {
        padding: 12px;
    }
    
    .file-card-actions {
        padding-left: 0;
        margin-top: 8px;
        flex-wrap: wrap;
    }
    
    .file-card-actions .ios-btn-sm {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .file-card-main {
        margin-bottom: 8px;
    }
    
    .navbar-ios {
        padding: 0 12px;
    }
    
    .ios-page-header h2 {
        font-size: 18px;
    }
    
    .ios-btn-lg {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .ios-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ios-card-header form {
        width: 100%;
    }
    
    .ios-input-group {
        width: 100%;
    }
}

/* ============================================
   Touch-friendly improvements
   ============================================ */
@media (pointer: coarse) {
    .ios-btn,
    .ios-btn-sm {
        min-height: 40px;
    }
    
    .ios-btn-lg {
        min-height: 48px;
    }
    
    .ios-input {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    
    .nav-link,
    .theme-toggle {
        min-height: 44px;
    }
    
    .file-card {
        padding-top: 18px;
        padding-bottom: 18px;
    }
    
    .ios-checkbox input[type="checkbox"],
    .ios-radio input[type="radio"] {
        width: 26px;
        height: 26px;
    }
    
    .ios-checkbox input[type="checkbox"]:checked::after {
        left: 7px;
        top: 3px;
        width: 6px;
        height: 12px;
    }
    
    .ios-radio input[type="radio"]:checked::after {
        left: 6px;
        top: 6px;
        width: 10px;
        height: 10px;
    }
}
