/* 哈希28内部专用CDN管理系统 - 样式表 */

/* ===== 变量定义 ===== */
:root {
    --bg-primary: #12121f;
    --bg-secondary: #1a1a2e;
    --bg-card: #252540;
    --bg-input: #1a1a2e;
    --border-color: #333;
    --text-primary: #fff;
    --text-secondary: #aaa;
    --text-muted: #666;
    --accent-orange: #ff6b35;
    --accent-green: #69f0ae;
    --accent-blue: #2196f3;
    --accent-purple: #ce93d8;
    --accent-red: #f44336;
    --accent-yellow: #ffc107;
    --sidebar-width: 220px;
    --header-height: 60px;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ===== 登录页 ===== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--accent-orange);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ===== 主布局 ===== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0f0f1a 0%, var(--bg-secondary) 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo-title {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-orange);
}

.logo-subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.nav {
    flex: 1;
    padding: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 4px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: linear-gradient(90deg, var(--accent-orange) 0%, #f7931e 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

.nav-icon {
    font-size: 16px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(244,67,54,0.1);
    color: var(--accent-red);
    text-decoration: none;
}

/* ===== 主内容区 ===== */
.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.header {
    height: var(--header-height);
    background: linear-gradient(90deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.content {
    flex: 1;
    padding: 30px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-orange) 0%, #f7931e 100%);
    color: #fff;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-success {
    background: linear-gradient(90deg, #00c853 0%, var(--accent-green) 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(90deg, #ff9800 0%, var(--accent-yellow) 100%);
    color: #000;
}

.btn-danger {
    background: rgba(244,67,54,0.2);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

/* ===== 卡片 ===== */
.card {
    background: linear-gradient(180deg, var(--bg-card) 0%, #1e1e35 100%);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    font-size: 14px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(180deg, var(--bg-card) 0%, #1e1e35 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-value.blue { color: var(--accent-blue); }
.stat-value.green { color: var(--accent-green); }
.stat-value.orange { color: var(--accent-orange); }
.stat-value.purple { color: var(--accent-purple); }
.stat-value.gray { color: var(--text-muted); }

.stat-desc {
    color: var(--text-muted);
    font-size: 11px;
}

/* ===== 表格 ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.table td {
    font-size: 13px;
}

.table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.table .actions {
    white-space: nowrap;
}

.table .actions .btn {
    margin-right: 6px;
}

/* ===== 状态标签 ===== */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.deployed {
    background: rgba(105,240,174,0.15);
    color: var(--accent-green);
}

.status-badge.deploying {
    background: rgba(255,107,53,0.15);
    color: var(--accent-orange);
}

.status-badge.disabled {
    background: rgba(102,102,102,0.2);
    color: var(--text-muted);
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-group .required {
    color: var(--accent-red);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.2s;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent-orange);
}

.select {
    cursor: pointer;
}

.textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-row .form-group.flex-2 {
    flex: 2;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h4 {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-orange);
}

/* ===== 筛选栏 ===== */
.filter-card {
    padding: 16px 20px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group .input,
.filter-group .select {
    width: auto;
    min-width: 150px;
}

/* ===== 快捷操作 ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
    transform: translateY(-2px);
}

.quick-icon {
    font-size: 24px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 16px;
}

/* ===== 提示/警告 ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-error {
    background: rgba(244,67,54,0.15);
    color: var(--accent-red);
    border: 1px solid rgba(244,67,54,0.3);
}

.alert-success {
    background: rgba(105,240,174,0.15);
    color: var(--accent-green);
    border: 1px solid rgba(105,240,174,0.3);
}

.info-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(33,150,243,0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(33,150,243,0.2);
}

.info-icon {
    font-size: 20px;
}

.info-content strong {
    display: block;
    margin-bottom: 4px;
}

.info-content p {
    color: var(--text-secondary);
    font-size: 13px;
}

/* ===== Toast通知 ===== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--accent-green);
    color: #000;
}

.toast.error {
    background: var(--accent-red);
    color: #fff;
}

/* ===== 表单容器 ===== */
.form-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    align-items: start;
}

.form-card {
    min-height: 600px;
}

.tips-card {
    position: sticky;
    top: 80px;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.tips-list li:last-child {
    border-bottom: none;
}

.tips-warning {
    margin-top: 16px;
    padding: 12px;
    background: rgba(255,193,7,0.1);
    border-radius: var(--border-radius);
    color: var(--accent-yellow);
    font-size: 12px;
}

/* ===== 操作日志标签 ===== */
.action-tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.action-tag.create { background: rgba(105,240,174,0.15); color: var(--accent-green); }
.action-tag.update { background: rgba(33,150,243,0.15); color: var(--accent-blue); }
.action-tag.delete { background: rgba(244,67,54,0.15); color: var(--accent-red); }
.action-tag.enable { background: rgba(105,240,174,0.15); color: var(--accent-green); }
.action-tag.disable { background: rgba(102,102,102,0.2); color: var(--text-muted); }
.action-tag.invalidation { background: rgba(255,107,53,0.15); color: var(--accent-orange); }

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.page-link {
    padding: 8px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.page-info {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== 设置页 ===== */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-muted);
    font-size: 13px;
}

.info-value {
    color: var(--text-primary);
    font-size: 13px;
}

.link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.link-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    text-decoration: none;
}

.link-arrow {
    margin-left: auto;
    color: var(--text-muted);
}

/* ===== 源站标签 ===== */
.origin-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    margin: 2px 0;
}

/* ===== 辅助类 ===== */
.text-primary { color: var(--accent-blue); }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 11px; }
.mt-4 { margin-top: 16px; }

.id-code {
    font-size: 11px;
    color: var(--accent-blue);
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
    .form-container {
        grid-template-columns: 1fr;
    }
    
    .tips-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        flex-direction: column;
    }
}

