* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); min-height: 100vh; padding: 20px; }

#loginOverlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); display: flex; justify-content: center; align-items: center; z-index: 1000; }
#loginOverlay.hidden { display: none; }
.login-box { background: white; padding: 40px; border-radius: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); width: 380px; }
.login-box h2 { text-align: center; margin-bottom: 30px; color: #333; font-size: 24px; }
.login-box input { width: 100%; padding: 14px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; }
.login-box button { width: 100%; padding: 14px; background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; font-weight: bold; }
.login-box button:hover { opacity: 0.9; }
#loginError { color: #dc3545; text-align: center; margin-top: 10px; display: none; font-size: 14px; }

#mainContainer.hidden { display: none; }
.container { max-width: 1400px; margin: 0 auto; }
h1 { text-align: center; margin-bottom: 30px; color: white; font-size: 32px; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.card { 
    background: white; 
    padding: 25px; 
    margin-bottom: 20px; 
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}
.card h2 { margin-bottom: 20px; color: #333; border-bottom: 2px solid #667eea; padding-bottom: 10px; font-size: 18px; }

.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; color: #555; font-size: 14px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; }
.form-group textarea { resize: vertical; min-height: 120px; }

input[type="text"], input[type="password"], input[type="number"], select {
    padding: 12px 14px !important;
    font-size: 15px !important;
    border-radius: 8px !important;
    min-height: 44px;
    transition: all 0.2s ease;
    border: 1px solid #ddd;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}
input::placeholder {
    color: #999;
}

.btn { 
    padding: 12px 24px; 
    border: none; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 14px; 
    margin-right: 10px; 
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn:hover::before {
    left: 100%;
}
.btn-primary { background: #007bff; color: white; }
.btn-success { background: #28a745; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-info { background: #17a2b8; color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; margin-right: 5px; margin-bottom: 5px; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    transform: none; 
}

.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.log { background: #1e1e1e; color: #0f0; padding: 20px; border-radius: 8px; font-family: 'Consolas', monospace; font-size: 14px; white-space: pre-wrap; max-height: 250px; overflow-y: auto; line-height: 1.6; }
.receiver-list { max-height: 400px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; }
.receiver-item { padding: 12px 15px; border-bottom: 1px solid #eee; }
.receiver-item:last-child { border-bottom: none; }
.status { padding: 12px; margin-top: 10px; border-radius: 8px; font-size: 14px; }
.status.success { background: #d4edda; color: #155724; }
.status.error { background: #f8d7da; color: #721c24; }
.grid { display: grid; gap: 20px; }
.grid-2col { grid-template-columns: repeat(2, 1fr); }
.header-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.logout-btn { background: #dc3545; color: white; padding: 8px 20px; border-radius: 6px; cursor: pointer; border: none; font-size: 14px; }
.log-list { max-height: 300px; overflow-y: auto; }
.log-item { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; font-size: 13px; line-height: 1.6; }
.log-time { color: #999; margin-right: 8px; }
.log-op { color: #007bff; font-weight: 500; margin-right: 8px; }
.log-result { color: #28a745; }
.log-result.fail { color: #dc3545; }

#subscriberList { overflow-x: auto; max-height: 1200px; overflow-y: auto; width: 100%; position: relative; }
#subscriberList .table-wrapper { position: relative; }
#subscriberList table { min-width: 1200px; width: 100%; border-collapse: collapse; }
#subscriberList th { position: sticky; top: 0; background: #f5f5f5; z-index: 1; box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1); }
#subscriberList th, #subscriberList td { padding: 10px 12px; white-space: nowrap; }
#subscriberList tbody tr:hover { background: #f8f9fa; }
#subscriberList tbody tr:nth-child(even) { background: #fafafa; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 4px; white-space: normal; }
.action-buttons .btn { margin-right: 0; }

.modal { position: fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:9999; }
.modal-content { background:#fff; border-radius:12px; min-width:450px; max-width:500px; max-height:90vh; overflow-y:auto; padding:25px; }
.modal-content h3 { margin-top:0; }
.modal-content input, .modal-content select { width:100%; padding:8px; margin:5px 0 15px; border:1px solid #ddd; border-radius:6px; }
.modal-buttons { text-align:right; margin-top:15px; }
.modal-buttons button { margin-left:10px; padding:6px 15px; cursor:pointer; }

table { width:100%; border-collapse:collapse; }
th, td { padding: 8px; text-align: left; border-bottom: 1px solid #eee; }
th { background: #f5f5f5; }

/* ========== 工具类样式 ========== */
.empty-state { text-align:center; color:#999; padding:30px; }
.info-box { background:#f8f9fa; padding:10px; border-radius:8px; min-height:60px; }
.text-muted { color:#999; text-align:center; }
.gap-10 { gap:10px; }
.mb-15 { margin-bottom:15px; }
.mt-12 { margin-top:12px; }
.mt-20 { margin-top:20px; }
.pt-20 { padding-top:20px; }
.border-top { border-top:2px solid #eee; }
.form-input { width:100%; padding:12px 14px; font-size:15px; border:1px solid #ddd; border-radius:8px; }
.form-select { padding:8px; border:1px solid #ddd; border-radius:6px; }
.flex-center { display:flex; align-items:center; }
.w-full { width:100%; }
.flex-1 { flex:1; }
.flex-2 { flex:2; }
.min-w-200 { min-width:200px; }
.max-w-300 { max-width:300px; }
.gold-type-label { display:flex; align-items:center; cursor:pointer; padding:4px 8px; border-radius:4px; transition:background 0.2s; }
.gold-type-label:hover { background:#f0f0f0; }
.check-container { max-height:150px; overflow-y:auto; border:1px solid #ddd; padding:10px; border-radius:6px; margin-top:5px; display:flex; flex-wrap:wrap; gap:8px; }

/* ========== 分页组件 ========== */
.pagination { margin-top:15px; text-align:center; display:flex; justify-content:center; align-items:center; gap:5px; flex-wrap:wrap; }
.page-info { color:#666; font-size:13px; margin-right:8px; }
.page-ellipsis { color:#999; font-size:13px; padding:0 4px; }
.page-active { opacity:0.85; cursor:default !important; }
.page-jump { color:#666; font-size:13px; margin-left:8px; display:inline-flex; align-items:center; gap:4px; }
.page-jump input { width:45px; padding:4px; border:1px solid #ddd; border-radius:4px; text-align:center; font-size:13px; }

/* ========== 可折叠卡片 ========== */
.collapse-toggle { cursor:pointer; user-select:none; margin-bottom:0 !important; }
.collapse-toggle .collapse-icon { float:right; font-size:14px; transition:transform 0.2s; }
.card.collapsed .collapse-body { display:none; }
.card.collapsed .collapse-toggle { border-bottom:none !important; margin-bottom:0 !important; }

/* ========== 操作日志头部 ========== */
.log-header-right { float:right; display:flex; gap:10px; align-items:center; }

/* ========== 响应式断点 ========== */
@media (max-width: 1200px) {
    .grid { grid-template-columns: 1fr; }
    .container { padding: 10px; }
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .card { padding: 15px; }
    .card h2 { font-size: 16px; }
    .flex { flex-direction: column; align-items: stretch; gap: 10px; }
    .btn { margin-right: 0; margin-bottom: 10px; width: 100%; }
    .modal-content { min-width: 90%; margin: 10px; }
    .login-box { width: 90%; padding: 25px; }
    .header-bar { flex-direction: column; gap: 15px; }
    .header-bar h1 { margin-bottom: 0; }
    .log-header-right { float: none; flex-wrap: wrap; }
    .log-header-right .btn { width: auto; margin-bottom: 5px; }
}

@media (max-width: 480px) {
    input[type="text"], input[type="password"], input[type="number"], select {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
    .btn { padding: 10px 16px; font-size: 13px; }
    .btn-sm { padding: 4px 8px; font-size: 11px; }
}
