/* PVChina 管理后台 - 浅色卡片风格（对齐 niwi.cc SD Prompt Generator） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #f5f5f5;
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
.app-bar {
    background: #fafafa;
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid #e5e5e5;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
}
.app-bar-title { font-size: 16px; font-weight: 600; }
.app-bar-title strong { font-weight: 700; }
.app-bar-user { margin-left: auto; font-size: 12px; color: #999; }
.app-bar-user a { color: #1a1a1a; text-decoration: none; font-weight: 500; }
.app-bar-user a:hover { text-decoration: underline; }
.nav-pane {
    width: 240px;
    background: #fafafa;
    position: fixed;
    top: 48px; left: 0; bottom: 0;
    border-right: 1px solid #e5e5e5;
    padding: 12px 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 4px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.15s;
}
.nav-item:hover { color: #1a1a1a; background: #f0f0f0; }
.nav-item.active { color: #fff; background: #1a1a1a; }
.nav-item i { font-size: 16px; width: 20px; text-align: center; }
.main-content { margin-left: 240px; margin-top: 48px; padding: 24px; }
.page-header { font-size: 28px; font-weight: 600; margin-bottom: 24px; letter-spacing: -0.5px; }
.section-header {
    font-size: 13px; color: #666;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px;
    margin: 32px 0 16px; padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}
.metro-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.metro-input {
    width: 100%;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #1a1a1a;
    padding: 10px 14px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.metro-input:focus { border-color: #1a1a1a; }
.metro-input::placeholder { color: #999; }
.metro-label {
    display: block;
    font-size: 12px; color: #666;
    font-weight: 600; letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.metro-btn {
    display: inline-block;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #1a1a1a;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px; font-weight: 500; text-decoration: none;
    transition: all 0.15s; cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.metro-btn:hover { background: #f0f0f0; color: #1a1a1a; text-decoration: none; }
.metro-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.metro-btn.cyan { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.metro-btn.cyan:hover { background: #333; border-color: #333; color: #fff; }
.metro-btn.magenta { background: #dc3545; border-color: #dc3545; color: #fff; }
.metro-btn.magenta:hover { background: #c82333; border-color: #c82333; color: #fff; }
.metro-btn.lime { background: #22c55e; border-color: #22c55e; color: #fff; }
.metro-btn.lime:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.metro-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #b91c1c;
}
.metro-alert.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.metro-list {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
}
.metro-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.metro-list-item:last-child { border-bottom: none; }
.metro-list-item:hover { background: #fafafa; }
.list-item-title { font-size: 14px; font-weight: 500; }
.list-item-meta { font-size: 12px; color: #999; }
.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.status-active { background: rgba(34,197,94,0.12); color: #16a34a; }
.status-inactive { background: rgba(220,38,38,0.12); color: #dc2626; }
.link-count {
    display: inline-block;
    background: rgba(59,130,246,0.12);
    color: #2563eb;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px; font-weight: 600;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s;
    margin-left: 4px;
    cursor: pointer;
}
.btn-icon:hover { background: #f0f0f0; color: #1a1a1a; text-decoration: none; }
.btn-edit { color: #2563eb; border-color: #2563eb; }
.btn-edit:hover { background: #2563eb; border-color: #2563eb; color: #fff; }
.btn-delete { color: #dc3545; border-color: #dc3545; }
.btn-delete:hover { background: #dc3545; border-color: #dc3545; color: #fff; }
.btn-links { color: #16a34a; border-color: #16a34a; }
.btn-links:hover { background: #16a34a; border-color: #16a34a; color: #fff; }
.form-check-input { accent-color: #1a1a1a; }
.form-check-label { color: #666; font-size: 13px; }
.filter-select {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    color: #1a1a1a;
    padding: 8px 12px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    outline: none;
    min-width: 200px;
}
.filter-select:focus { border-color: #1a1a1a; }
.filter-select option { background: #fff; color: #1a1a1a; }
.url-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #999; font-size: 12px; }
.sortable-item { cursor: default; touch-action: none; user-select: none; -webkit-user-select: none; }
.drag-handle { color: #999; cursor: grab; padding: 12px; margin: -8px; margin-right: 0; transition: color 0.15s; touch-action: none; -webkit-tap-highlight-color: transparent; }
.drag-handle:hover { color: #1a1a1a; }
.drag-handle:active { cursor: grabbing; }
.sortable-item.dragging { opacity: 0.5; background: #fafafa; }
.sort-hint { color: #999; font-size: 12px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.sort-arrows { display: inline-flex; flex-direction: column; margin-left: 4px; gap: 1px; }
.sort-arrow {
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    color: #666;
    width: 22px; height: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; cursor: pointer; padding: 0; line-height: 1;
    transition: all 0.15s;
}
.sort-arrow:hover { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }
.sort-arrow:active { opacity: 0.7; }
.save-order-btn {
    display: none;
    background: #dc3545;
    border: 1px solid #dc3545;
    border-radius: 8px;
    color: #fff;
    padding: 10px 20px;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.15s;
}
.save-order-btn.show { display: inline-block; }
.save-order-btn:hover { background: #c82333; border-color: #c82333; }
.save-order-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.live-tile {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: box-shadow 0.15s;
}
.live-tile:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.tile-number { font-size: 36px; font-weight: 700; line-height: 1; }
.tile-label { font-size: 11px; color: #999; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; display: inline-block; }
.empty-hint { text-align: center; padding: 40px; color: #999; }
.empty-hint i { font-size: 2rem; display: block; margin-bottom: 10px; }

/* 登录页（admin/login.html） */
.login-panel {
    max-width: 400px;
    margin: 10vh auto 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 24px; font-weight: 700; }
.login-header p { color: #999; font-size: 13px; margin-top: 4px; }
.login-panel .metro-input { margin-bottom: 14px; }
.metro-btn-primary {
    width: 100%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px; font-weight: 500;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.metro-btn-primary:hover { opacity: 0.9; }
.metro-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.metro-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 13px;
    margin-top: 16px;
}
.metro-link:hover { text-decoration: underline; }

/* 系统设置行 */
.settings-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.settings-row:last-child { border-bottom: none; }

/* 删除确认弹窗 */
.modal-content { background: #fff; border: 1px solid #e5e5e5; color: #1a1a1a; border-radius: 12px; }
.modal-title { color: #1a1a1a; }
.modal-body { color: #1a1a1a; }
.modal-header { border-bottom: 1px solid #f0f0f0; }
.modal-footer { border-top: 1px solid #f0f0f0; }

@media (max-width: 768px) {
    .nav-pane { width: 100%; position: relative; top: 0; border-right: none; border-bottom: 1px solid #e5e5e5; }
    .main-content { margin-left: 0; margin-top: 48px; }
}

/* 暗黑模式 */
@media (prefers-color-scheme: dark) {
    body { background: #1a1a1a; color: #e5e5e5; }
    .app-bar { background: #202020; border-bottom-color: #3a3a3a; }
    .app-bar-user { color: #777; }
    .app-bar-user a { color: #bbb; }
    .app-bar-user a:hover { color: #fff; }
    .nav-pane { background: #1e1e1e; border-right-color: #3a3a3a; }
    .nav-item { color: #aaa; }
    .nav-item:hover { color: #fff; background: #2a2a2a; }
    .nav-item.active { color: #fff; background: #3a3a3a; }
    .section-header { color: #999; border-bottom-color: #3a3a3a; }
    .metro-panel { background: #262626; border-color: #3a3a3a; box-shadow: none; }
    .metro-input { background: #1e1e1e; border-color: #3a3a3a; color: #e5e5e5; }
    .metro-input:focus { border-color: #e5e5e5; }
    .metro-input::placeholder { color: #777; }
    .metro-label { color: #999; }
    .metro-btn { background: #2a2a2a; border-color: #3a3a3a; color: #e5e5e5; }
    .metro-btn:hover { background: #3a3a3a; color: #fff; }
    .metro-btn.cyan { background: #f5f5f5; border-color: #f5f5f5; color: #1a1a1a; }
    .metro-btn.cyan:hover { background: #e5e5e5; border-color: #e5e5e5; color: #1a1a1a; }
    .metro-alert { background: rgba(220,53,69,0.12); border-color: rgba(220,53,69,0.35); color: #f87171; }
    .metro-alert.success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); color: #4ade80; }
    .metro-list { background: #262626; border-color: #3a3a3a; }
    .metro-list-item { border-bottom-color: #333; }
    .metro-list-item:hover { background: #2a2a2a; }
    .status-active { background: rgba(34,197,94,0.15); color: #4ade80; }
    .status-inactive { background: rgba(220,38,38,0.15); color: #f87171; }
    .link-count { background: rgba(59,130,246,0.15); color: #60a5fa; }
    .btn-icon { background: #2a2a2a; border-color: #3a3a3a; color: #bbb; }
    .btn-icon:hover { background: #3a3a3a; color: #fff; }
    .form-check-label { color: #999; }
    .form-check-input { accent-color: #e5e5e5; }
    .filter-select { background: #1e1e1e; border-color: #3a3a3a; color: #e5e5e5; }
    .filter-select:focus { border-color: #e5e5e5; }
    .filter-select option { background: #1e1e1e; color: #e5e5e5; }
    .url-cell { color: #777; }
    .drag-handle:hover { color: #fff; }
    .sortable-item.dragging { background: #2a2a2a; }
    .sort-arrow { border-color: #3a3a3a; color: #aaa; }
    .sort-arrow:hover { background: #e5e5e5; border-color: #e5e5e5; color: #1a1a1a; }
    .live-tile { background: #262626; border-color: #3a3a3a; box-shadow: none; }
    .tile-label { color: #777; }
    .empty-hint { color: #777; }
    .login-panel { background: #262626; border-color: #3a3a3a; box-shadow: none; }
    .metro-btn-primary { background: #f5f5f5; color: #1a1a1a; }
    .metro-link { color: #e5e5e5; }
    .settings-row { border-bottom-color: #333; }
    .modal-content { background: #262626; border-color: #3a3a3a; color: #e5e5e5; }
    .modal-title { color: #e5e5e5; }
    .modal-body { color: #e5e5e5; }
    .modal-header { border-bottom-color: #333; }
    .modal-footer { border-top-color: #333; }
    .modal-header .btn-close { filter: invert(1); }
}
