:root {
    --bg-body: #000000;
    --bg-card: #1c1c1e;
    --bg-grouped: #000000;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-placeholder: #636366;
    --separator: #38383a;
    --accent: #0a84ff;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
    
    --nav-height: 44px;
    --tab-bar-height: 50px; /* iOS default is 49px + safe area */
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    height: 100%;
    overflow: hidden; /* Prevent elastic scrolling on body */
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* Prevent body scroll, handle in main */
    height: 100%;
    width: 100%;
    position: fixed; /* Fix for iOS scroll bounce */
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

/* App Container */
.app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Navbar */
.navbar {
    height: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 16px;
    background-color: var(--bg-body);
    z-index: 10;
    flex-shrink: 0;
    position: relative;
}

.navbar-title {
    font-size: 17px;
    font-weight: 600;
    position: absolute;
    left: 50%;
    bottom: 12px; /* Center vertically relative to the 44px content area */
    transform: translateX(-50%);
    white-space: nowrap;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 17px;
    padding: 8px;
    cursor: pointer;
    /* Increase touch target */
    min-width: 44px; 
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* 顶部导航按钮图标兜底：CDN 图标字体慢/失败时，至少显示文字符号（‹ ↻ +） */
.navbar .nav-btn i {
    display: none;
}
.navbar .nav-btn .nav-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 22px;
    line-height: 1;
    font-weight: 600;
    color: var(--accent);
    user-select: none;
}
.fa-ready .navbar .nav-btn i {
    display: inline-block;
}
.fa-ready .navbar .nav-btn .nav-fallback {
    display: none;
}

/* Main Content */
.content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Enable momentum scrolling */
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + 20px); /* Add extra padding */
    background-color: var(--bg-body);
}

/* 文件浏览器页面特殊处理 */
#panel-files .content {
    padding: 0;
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

/* 文件输入框iOS优化 */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

/* iOS文件选择优化 */
input[type="file"]:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0.01;
}

.panel {
    display: none;
    padding: 12px;
    padding-bottom: 40px; /* Extra padding for bottom content */
    /* Remove animation for better performance/less flicker on mobile */
    /* animation: fadeIn 0.3s ease; */
}

.panel.active {
    display: block;
}

.panel.terminal-view.active {
    display: flex;
}

/* Detail View (Full Screen Overlay) */
.panel.detail-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-body);
    z-index: 20;
    padding: 0;
    padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-content {
    padding: 16px;
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + 40px);
}

/* Tab Bar */
.tab-bar {
    height: calc(var(--tab-bar-height) + var(--safe-area-bottom));
    background-color: rgba(28, 28, 30, 0.85); /* Slightly more transparent */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    position: absolute; /* Changed from fixed to absolute within fixed body container */
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
}

.tab-item {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    gap: 4px;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.tab-item.active {
    color: var(--accent);
}

/* List Group (iOS Settings Style) */
.list-group {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.list-group-title {
    padding: 16px 16px 8px;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    min-height: 48px;
}

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

.list-item:active {
    background-color: #2c2c2e;
}

.item-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 14px;
}

.item-body {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-title {
    font-weight: 400;
}

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

.item-after {
    color: var(--text-secondary);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.about-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
}
.about-link:active {
    opacity: 0.8;
}

/* Status Cards */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.status-card {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 14px;
    position: relative;
    transition: transform 0.2s;
    margin-bottom: 12px;
}

.status-card:active {
    transform: scale(0.98);
}

.card-header {
    margin-bottom: 12px;
}

.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--text-secondary);
    font-size: 16px;
}

.card-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.metrics-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.metric-group {
    flex: 1;
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.metric-bar-bg {
    height: 6px;
    background-color: #3a3a3c;
    border-radius: 3px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    background-color: var(--success);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.metric-value {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

/* Enhanced Status Card Styles */
.metric-section {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 0.5px solid var(--separator);
}

.metric-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-value-large {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* CPU Details */
.cpu-details {
    display: flex;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.cpu-detail-item {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background-color: var(--danger); }
.dot-green { background-color: var(--success); }
.dot-orange { background-color: var(--warning); }
.dot-purple { background-color: #af52de; }

/* CPU Cores Visualization */
.cpu-cores {
    display: flex;
    gap: 2px;
    height: 18px;
    margin-bottom: 6px;
    border-radius: 4px;
    overflow: hidden;
}

.core-bar {
    height: 100%;
    transition: opacity 0.3s ease;
    border-radius: 2px;
}

/* System Stats */
.system-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Memory Details */
.memory-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 8px;
}

.memory-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.memory-label {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.memory-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Network Details */
.network-details {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

.network-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.network-icon {
    font-size: 16px;
    color: var(--accent);
    margin-bottom: 4px;
}

.network-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.network-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Ring Progress */
.ring-progress {
    position: relative;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.ring-fill {
    fill: none;
    stroke: var(--success);
    stroke-width: 3;
    stroke-dasharray: 99.9;
    stroke-dashoffset: 99.9;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
}

.ring-text {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Disk Styles */
.disk-list {
    margin-top: 8px;
}

.disk-item {
    margin-bottom: 10px;
    padding: 6px 0;
}

.disk-item:last-child {
    margin-bottom: 0;
}

.disk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.disk-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.disk-type {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 2px 6px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.disk-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.disk-usage {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Detail Sections */
.detail-section {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-row span:first-child {
    color: var(--text-secondary);
}

/* Buttons */
.btn-text {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    padding: 8px;
}

.btn-text.primary {
    font-weight: 600;
}

.btn-text.danger {
    color: var(--danger);
}

.btn-block {
    display: block;
    width: 100%;
    background-color: var(--bg-card);
    color: var(--accent);
    border: none;
    padding: 14px;
    font-size: 16px;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 24px;
}

.btn-block:active {
    background-color: #2c2c2e;
}

/* Sheet Modal */
.sheet-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    visibility: visible;
    transition: visibility 0s 0.3s;
}

.sheet-modal.hidden {
    visibility: hidden;
}

.sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    opacity: 1;
    transition: opacity 0.3s;
}

.sheet-modal.hidden .sheet-backdrop {
    opacity: 0;
}

.sheet-box {
    background-color: #1c1c1e;
    border-radius: 16px 16px 0 0;
    padding-bottom: var(--safe-area-bottom);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 201;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.sheet-modal.hidden .sheet-box {
    transform: translateY(100%);
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--separator);
}

.sheet-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.sheet-content {
    padding: 16px;
    overflow-y: auto;
}

.sheet-desc {
    font-size: 13px;
    color: var(--text-tertiary, #8e8e93);
    margin: 0 0 12px;
    line-height: 1.4;
}

/* Forms */
.form-list {
    margin-bottom: 0;
}

.input-item {
    display: flex;
    align-items: center;
}

.input-item .label {
    width: 80px;
    font-size: 16px;
}

.input-item input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    padding: 0;
    height: 24px;
}

.input-item input:focus {
    outline: none;
}

/* Terminal */
.panel.terminal-view {
    /* Override default panel block display when active */
    display: none; 
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.panel.terminal-view.active {
    display: flex;
}

.terminal-toolbar {
    padding: 8px 16px;
    background-color: var(--bg-card);
    display: flex;
    gap: 12px;
    align-items: center;
    border-bottom: 0.5px solid var(--separator);
}

.ios-select {
    flex: 1;
    background: #2c2c2e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    appearance: none; /* remove default arrow */
}

.terminal-window {
    flex: 1;
    background-color: #000;
    display: flex;
    flex-direction: column;
    padding: 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    position: relative;
    overflow: hidden;
    min-height: 0; /* Important for flex scrolling */
}

#terminalOutput {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 8px;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 12px;
    line-height: 1.4;
    color: #0f0;
    -webkit-overflow-scrolling: touch;
    /* Ensure output area can scroll */
    min-height: 0;
}

.terminal-input {
    background-color: #000;
    border: none;
    border-top: 1px solid #333;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    padding: 12px 8px;
    width: 100%;
    flex-shrink: 0; /* Prevent input from shrinking */
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.terminal-input:focus {
    outline: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

.tip-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 20px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(44, 44, 46, 0.9);
    backdrop-filter: blur(10px);
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 300;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-align: center;
}

.toast.hidden {
    display: none;
}

.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}
.badge.running { background: rgba(48, 209, 88, 0.2); color: var(--success); }
.badge.stopped { background: rgba(255, 69, 58, 0.2); color: var(--danger); }

/* --- Theme Support --- */

/* Theme: Cyberpunk */
body.theme-cyberpunk {
    --bg-body: #050505;
    --bg-card: #000000;
    --bg-grouped: #000000;
    --text-primary: #00ff41;
    --text-secondary: #008F11;
    --separator: #003b00;
    --accent: #00ff41;
    --danger: #ff0055;
    --success: #00ff41;
    font-family: "Courier New", Courier, monospace;
}
body.theme-cyberpunk .card,
body.theme-cyberpunk .status-card,
body.theme-cyberpunk .list-group,
body.theme-cyberpunk .detail-section,
body.theme-cyberpunk .terminal-toolbar,
body.theme-cyberpunk .navbar,
body.theme-cyberpunk .sheet-box,
body.theme-cyberpunk .sheet-header {
    border: 1px solid var(--accent);
    border-radius: 0;
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.2);
}
body.theme-cyberpunk .tab-bar {
    border-top: 1px solid var(--accent);
    background-color: #000;
}
body.theme-cyberpunk .ring-progress {
    border-radius: 0;
}
body.theme-cyberpunk .metric-bar-bg {
    border-radius: 0;
    background-color: #003b00;
}
body.theme-cyberpunk .metric-bar-fill {
    border-radius: 0;
}

/* Theme: Glassmorphism */
body.theme-glass {
    --bg-body: #0f2027; /* Fallback */
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-grouped: transparent;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --separator: rgba(255, 255, 255, 0.1);
    --accent: #00d2ff;
}
body.theme-glass {
    background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364); 
    background-attachment: fixed;
}
body.theme-glass .navbar,
body.theme-glass .tab-bar {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
}
body.theme-glass .status-card,
body.theme-glass .list-group,
body.theme-glass .detail-section,
body.theme-glass .sheet-box {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    background-color: rgba(255, 255, 255, 0.1);
}

/* Theme: Minimalist Light */
body.theme-minimal {
    --bg-body: #ffffff;
    --bg-card: #ffffff;
    --bg-grouped: #f5f5f7;
    --text-primary: #000000;
    --text-secondary: #666666;
    --separator: #eaeaea;
    --accent: #000000;
    --danger: #ff3b30;
    --success: #34c759;
}
body.theme-minimal .status-card,
body.theme-minimal .list-group,
body.theme-minimal .detail-section,
body.theme-minimal .sheet-box {
    border: 1px solid #eaeaea;
    box-shadow: none;
}
body.theme-minimal .tab-bar,
body.theme-minimal .navbar {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #eaeaea;
    border-bottom: 1px solid #eaeaea;
}
body.theme-minimal .item-icon {
    border-radius: 50%;
}
body.theme-minimal .status-card {
    border-radius: 8px;
}
body.theme-minimal .list-group {
    border-radius: 8px;
}

/* --- New iOS Style Themes --- */

/* Theme: iOS 17 Modern Style */
body.theme-ios17 {
    --bg-body: #000000;
    --bg-card: #1c1c1e;
    --bg-grouped: #000000;
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-placeholder: #636366;
    --separator: #38383a;
    --accent: #0a84ff;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
}
body.theme-ios17 .status-card,
body.theme-ios17 .list-group,
body.theme-ios17 .detail-section {
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 0.5px solid rgba(255, 255, 255, 0.05);
}
body.theme-ios17 .status-card:active {
    transform: scale(0.97);
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-ios17 .item-icon {
    border-radius: 10px;
}
body.theme-ios17 .metric-bar-bg {
    border-radius: 10px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.1);
}
body.theme-ios17 .metric-bar-fill {
    border-radius: 10px;
    background: linear-gradient(90deg, #0a84ff 0%, #5ac8fa 100%);
}
body.theme-ios17 .tab-bar {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background-color: rgba(28, 28, 30, 0.8);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
}
body.theme-ios17 .navbar {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background-color: rgba(0, 0, 0, 0.8);
}

/* Theme: iOS Dark Mode (Pure Black) */
body.theme-ios-dark {
    --bg-body: #000000;
    --bg-card: #1c1c1e;
    --bg-grouped: #000000;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-placeholder: #636366;
    --separator: #38383a;
    --accent: #0a84ff;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
}
body.theme-ios-dark .status-card,
body.theme-ios-dark .list-group,
body.theme-ios-dark .detail-section,
body.theme-ios-dark .sheet-box {
    background-color: #1c1c1e;
    border: 0.5px solid #38383a;
}
body.theme-ios-dark .tab-bar,
body.theme-ios-dark .navbar {
    background-color: #000000;
    border-top: 0.5px solid #38383a;
}
body.theme-ios-dark .list-item:active {
    background-color: #2c2c2e;
}
body.theme-ios-dark .metric-bar-bg {
    background-color: #38383a;
}

/* Theme: iOS Light Mode */
body.theme-ios-light {
    --bg-body: #f2f2f7;
    --bg-card: #ffffff;
    --bg-grouped: #f2f2f7;
    --text-primary: #000000;
    --text-secondary: #6d6d70;
    --text-placeholder: #8e8e93;
    --separator: #c6c6c8;
    --accent: #007aff;
    --danger: #ff3b30;
    --success: #34c759;
    --warning: #ff9500;
}
body.theme-ios-light .status-card,
body.theme-ios-light .list-group,
body.theme-ios-light .detail-section,
body.theme-ios-light .sheet-box {
    background-color: #ffffff;
    border: 0.5px solid #e5e5ea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
body.theme-ios-light .tab-bar,
body.theme-ios-light .navbar {
    background-color: rgba(242, 242, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid #e5e5ea;
}
body.theme-ios-light .list-item:active {
    background-color: #f2f2f7;
}
body.theme-ios-light .metric-bar-bg {
    background-color: #e5e5ea;
}
body.theme-ios-light .metric-bar-fill {
    background-color: var(--accent);
}
body.theme-ios-light .terminal-window {
    background-color: #1e1e1e;
}
body.theme-ios-light .item-icon {
    color: #ffffff;
}
body.theme-ios-light .system-stats {
    background-color: rgba(0, 0, 0, 0.03);
}
body.theme-ios-light .ring-bg {
    stroke: rgba(0, 0, 0, 0.1);
}
body.theme-ios-light .disk-type {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Theme: iOS Gradient Style */
body.theme-ios-gradient {
    --bg-body: #000000;
    --bg-card: rgba(28, 28, 30, 0.6);
    --bg-grouped: transparent;
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --text-placeholder: #636366;
    --separator: rgba(255, 255, 255, 0.1);
    --accent: #5ac8fa;
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ff9f0a;
}
body.theme-ios-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
}
body.theme-ios-gradient .status-card,
body.theme-ios-gradient .list-group,
body.theme-ios-gradient .detail-section,
body.theme-ios-gradient .sheet-box {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background-color: rgba(28, 28, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border-radius: 18px;
}
body.theme-ios-gradient .tab-bar,
body.theme-ios-gradient .navbar {
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    background-color: rgba(28, 28, 30, 0.6);
    border-top: 0.5px solid rgba(255, 255, 255, 0.15);
}
body.theme-ios-gradient .metric-bar-fill {
    background: linear-gradient(90deg, #5ac8fa 0%, #007aff 100%);
}
body.theme-ios-gradient .list-item:active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Theme: iOS Card Style (Large Cards, More Spacing) */
body.theme-ios-card {
    --bg-body: #f5f5f7;
    --bg-card: #ffffff;
    --bg-grouped: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-placeholder: #86868b;
    --separator: #d2d2d7;
    --accent: #0071e3;
    --danger: #ff3b30;
    --success: #34c759;
    --warning: #ff9500;
}
body.theme-ios-card .status-grid {
    gap: 24px;
    padding: 20px;
}
body.theme-ios-card .status-card {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 0.5px solid #e5e5ea;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body.theme-ios-card .status-card:active {
    transform: scale(0.96);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
body.theme-ios-card .list-group {
    border-radius: 20px;
    margin-bottom: 32px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 0.5px solid #e5e5ea;
}
body.theme-ios-card .list-item {
    padding: 16px 20px;
    min-height: 56px;
}
body.theme-ios-card .item-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 16px;
}
body.theme-ios-card .tab-bar,
body.theme-ios-card .navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 0.5px solid #e5e5ea;
}
body.theme-ios-card .metric-bar-bg {
    height: 10px;
    border-radius: 10px;
    background-color: #f5f5f7;
}
body.theme-ios-card .metric-bar-fill {
    border-radius: 10px;
    background: linear-gradient(90deg, #0071e3 0%, #5ac8fa 100%);
}
body.theme-ios-card .list-item:active {
    background-color: #f5f5f7;
}
body.theme-ios-card .panel {
    padding: 20px;
}
body.theme-ios-card .card-title {
    font-size: 18px;
    font-weight: 600;
}
body.theme-ios-card .card-subtitle {
    font-size: 14px;
    margin-top: 4px;
}

/* ========== iOS优化样式 ========== */

/* iOS设备特定样式 */
body.ios-device {
    -webkit-touch-callout: none; /* 禁用长按菜单 */
    -webkit-user-select: none; /* 禁用文本选择 */
    user-select: none;
}

body.ios-device input,
body.ios-device textarea {
    -webkit-user-select: text; /* 输入框允许选择 */
    user-select: text;
}

/* iOS全屏模式 */
body.standalone-mode {
    /* 全屏模式下的特殊样式 */
}

/* 下拉刷新指示器 */
.pull-to-refresh-indicator {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border: 3px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}

.pull-to-refresh-indicator.active {
    opacity: 1;
    animation: spin 1s linear infinite;
}

/* 触摸反馈优化 */
button:active,
.list-item:active,
.tab-item:active {
    opacity: 0.6;
    transition: opacity 0.1s;
}

/* iOS键盘适配 */
@supports (-webkit-touch-callout: none) {
    .content {
        /* iOS Safari键盘弹出时的优化 */
        padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + env(keyboard-inset-height, 0px));
    }
}

/* 长按菜单样式 */
.long-press-menu {
    position: fixed;
    bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 400;
    min-width: 200px;
}

.long-press-menu-item {
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.long-press-menu-item:active {
    background: rgba(255, 255, 255, 0.1);
}

/* 优化滚动性能 */
.content,
.panel {
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
}

/* iOS安全区域适配 */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(env(safe-area-inset-top), 0px);
    }
    
    .tab-bar {
        padding-bottom: max(env(safe-area-inset-bottom), 0px);
    }
}

/* 防止iOS Safari橡皮筋效果 */
body {
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

/* iOS输入框优化 */
input[type="text"],
input[type="password"],
textarea {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

/* 终端输入框iOS优化 */
#terminalInput {
    font-size: 16px; /* 防止iOS自动缩放 */
    transform: translateZ(0); /* 硬件加速 */
}

/* 文件上传和编辑样式 */
.upload-path-input {
    font-family: monospace;
    font-size: 12px;
}

#editFileContent {
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    line-height: 1.6;
    tab-size: 4;
}

#fileUploadModal .sheet-box {
    max-height: 85vh;
}

#fileUploadModal .sheet-content {
    max-height: calc(85vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#fileUploadModal .list-item {
    margin-bottom: 8px;
    padding: 12px;
    background-color: var(--bg-card);
    border-radius: 8px;
}

#fileUploadModal .upload-path-input {
    font-family: monospace;
    font-size: 12px;
    flex: 1;
    min-width: 120px;
}

/* 文件编辑：全屏 */
.file-edit-fullscreen.sheet-modal .sheet-box.file-edit-sheet {
    max-height: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

/* 编辑界面顶部避开刘海（iOS 安全区） */
.file-edit-header {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
    flex-shrink: 0;
}

/* 教程弹层：全屏 + iframe 填满 */
#tutorialModal .sheet-box.tutorial-sheet {
    max-height: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.tutorial-iframe-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tutorial-iframe-wrap iframe {
    flex: 1;
    width: 100%;
    border: none;
    min-height: 0;
}

/* AI 弹层：全屏 */
#aiModal .sheet-box.ai-sheet {
    max-height: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}
.ai-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
}
.ai-config-toggle {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-secondary);
}
.ai-config-toggle:active {
    background: rgba(255,255,255,0.05);
}
.ai-config-icon {
    transition: transform 0.2s;
    font-size: 12px;
}
.ai-config-toggle.active .ai-config-icon {
    transform: rotate(180deg);
}
.ai-config-panel {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
}
.ai-config-panel.hidden {
    display: none;
}
.ai-response {
    flex: 1;
    min-height: 0;
    padding: 16px;
    background: #0b0b0c;
    color: #e8e8ea;
    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}
.ai-input-wrap {
    flex-shrink: 0;
    padding: 12px;
    background: var(--bg-card);
    border-top: 0.5px solid var(--separator);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.ai-upload-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid var(--separator);
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
}
.ai-upload-btn:active {
    background: rgba(255,255,255,0.1);
}
.ai-prompt {
    flex: 1;
    min-height: 80px;
    max-height: 200px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 0.5px solid var(--separator);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
}
.ai-prompt:focus {
    outline: none;
    border-color: rgba(10, 132, 255, 0.6);
    background: rgba(255,255,255,0.08);
}
.ai-send-btn {
    flex-shrink: 0;
    min-width: 60px;
    height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 500;
}
.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.ai-send-btn:active:not(:disabled) {
    opacity: 0.8;
}
.ai-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}
.ai-header-actions .btn-text {
    font-size: 14px;
    padding: 4px 8px;
}
.ai-files-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.ai-file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(10, 132, 255, 0.15);
    border-radius: 6px;
    font-size: 12px;
    color: var(--accent);
}
.ai-file-item .ai-file-remove {
    cursor: pointer;
    color: var(--danger);
    font-weight: bold;
}

.file-edit-fullscreen .file-edit-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0 12px 12px;
}

.file-edit-path-row {
    flex-shrink: 0;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.file-edit-path-row .label { flex-shrink: 0; }
.file-edit-path-row input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    background: var(--bg-card);
    border: 0.5px solid var(--separator);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
}

.file-edit-ace {
    flex: 1;
    min-height: 200px;
    width: 100%;
}

.file-edit-fallback {
    flex: 1;
    min-height: 300px;
    width: 100%;
    padding: 12px;
    background: var(--bg-card);
    border: 0.5px solid var(--separator);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

#editFileContent {
    flex: 1;
    min-height: 400px;
}

/* 优化卡片触摸区域 */
.status-card,
.list-item {
    touch-action: manipulation; /* 优化触摸响应 */
    -webkit-tap-highlight-color: transparent;
}

/* iOS状态栏适配 */
@supports (padding: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(env(safe-area-inset-top) + 0px);
    }
}

/* ========== 新增功能样式 ========== */

/* 刷新按钮动画 */
.nav-btn i.fa-sync-alt {
    transition: transform 0.3s ease;
}
.nav-btn:active i.fa-sync-alt {
    transform: rotate(180deg);
}

.nav-btn.refreshing i {
    animation: spin 1s linear infinite;
}

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

/* 容器操作菜单 */
.action-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: visible;
}

.action-menu.hidden {
    visibility: hidden;
}

.action-menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 1;
    transition: opacity 0.3s;
}

.action-menu.hidden .action-menu-backdrop {
    opacity: 0;
}

.action-menu-content {
    background-color: var(--bg-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 500px;
    padding-bottom: var(--safe-area-bottom);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 301;
}

.action-menu.hidden .action-menu-content {
    transform: translateY(100%);
}

.action-menu-item {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    text-align: left;
    border-bottom: 0.5px solid var(--separator);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.action-menu-item:last-child {
    border-bottom: none;
}

.action-menu-item:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-menu-item i {
    width: 20px;
    text-align: center;
}

/* 容器日志查看器 */
.container-logs {
    background-color: #000;
    color: #0f0;
    padding: 16px;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0;
}

/* 文件管理器 */
.file-path {
    padding: 12px 16px;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.file-list {
    padding: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
}

.file-item:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.file-item i {
    width: 20px;
    color: var(--accent);
}

.file-item span:first-of-type {
    flex: 1;
}

.file-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 文件浏览器（FTPManager风格） */
.file-browser-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.file-view {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.file-view.active {
    display: flex;
}

.file-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    background-color: var(--bg-body);
    border-bottom: 0.5px solid var(--separator);
    min-height: 40px;
    flex-shrink: 0;
}

.file-browser-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
    padding: 0 8px;
}

.file-browser-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 2px 4px;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    min-height: 40px;
    flex-shrink: 0;
}

.file-browser-toolbar .btn-text {
    padding: 4px 8px;
    font-size: 16px;
    min-width: 44px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-batch-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    flex-shrink: 0;
}
.file-batch-bar .btn-text { margin-left: auto; }
.file-select-checkbox { margin-right: 8px; flex-shrink: 0; }
.file-select-checkbox input { width: 20px; height: 20px; cursor: pointer; }

.file-browser-sort {
    display: flex;
    align-items: center;
    padding: 2px 8px;
    background-color: var(--bg-card);
    border-bottom: 0.5px solid var(--separator);
    gap: 8px;
    min-height: 32px;
    font-size: 12px;
    flex-shrink: 0;
}

.sort-item {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.sort-item.active {
    color: var(--accent);
    background-color: rgba(10, 132, 255, 0.1);
}

.sort-item:active {
    opacity: 0.6;
}

.file-browser-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
}

.file-browser-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    background-color: var(--bg-card);
    cursor: pointer;
    transition: background 0.2s;
}

.file-browser-item:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.file-item-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
    color: var(--accent);
}

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

.file-item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.file-item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.file-item-date {
    flex: 1;
}

.file-item-size {
    min-width: 60px;
    text-align: right;
}

.file-item-actions {
    margin-left: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
}

.btn-icon:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.file-browser-path {
    padding: 8px 16px;
    background-color: var(--bg-card);
    border-top: 0.5px solid var(--separator);
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.file-action-menu {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 150px;
    border: 0.5px solid var(--separator);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.file-menu-item {
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: background 0.2s;
    margin: 2px 0;
}

.file-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.file-menu-item:active {
    background-color: rgba(255, 255, 255, 0.15);
}

.file-menu-item.danger {
    color: var(--danger);
}

.file-menu-item.danger:active {
    background-color: rgba(255, 69, 58, 0.2);
}

.file-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

/* 图表容器 */
.chart-container {
    margin-top: 12px;
    height: 150px;
    position: relative;
}


/* 容器项增强 */
.container-item {
    position: relative;
}

.container-item .item-body {
    flex: 1;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.1) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-bar {
    height: 6px;
    margin-bottom: 12px;
}

/* 告警提示 */
.alert-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 批量操作样式 */
input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent);
}

#serverListActions {
    margin-bottom: 16px;
}

/* 批量操作结果 */
.batch-result {
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.batch-result.success {
    background-color: rgba(48, 209, 88, 0.1);
    color: var(--success);
}

.batch-result.error {
    background-color: rgba(255, 69, 58, 0.1);
    color: var(--danger);
}

/* 登录/注册 */
.auth-view {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: env(safe-area-inset-top) 24px env(safe-area-inset-bottom);
    z-index: 500;
}
.auth-view.hidden { display: none; }
.auth-inner { width: 100%; max-width: 320px; }
.auth-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
    flex: 1;
    padding: 10px;
    background: var(--bg-card);
    border: 0.5px solid var(--separator);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
}
.auth-tab.active { background: rgba(10, 132, 255, 0.15); color: var(--accent); border-color: var(--accent); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }
.auth-form input {
    padding: 12px 16px;
    background: var(--bg-card);
    border: 0.5px solid var(--separator);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 16px;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-btn {
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.auth-btn:active { opacity: 0.9; }
.auth-error { margin-top: 12px; font-size: 13px; color: var(--danger); text-align: center; }
.auth-error.hidden { display: none; }
