/**
 * 宽带数据查询系统 - 主样式文件
 * 设计风格：卡片式极简主义 + 冷色调渐变 + 响应式设计
 */

/* ===== CSS 变量定义 ===== */
:root {
    --primary: #4a90e2;
    --primary-dark: #357abd;
    --primary-light: #6ba5e7;
    --secondary: #5cb85c;
    --danger: #d9534f;
    --warning: #f0ad4e;
    --info: #5bc0de;
    
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ===== 基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ===== 登录界面 ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--gradient-primary);
    background-attachment: fixed;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 50px 40px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.5s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.logo i {
    font-size: 36px;
    color: white;
}

.login-logo {
    max-height: 60px;
    max-width: 200px;
    object-fit: contain;
    margin-bottom: 15px;
}

.login-header h1 {
    color: var(--gray-800);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--gray-600);
    font-size: 14px;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: var(--gray-700);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group label i {
    margin-right: 5px;
    color: var(--primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-500);
}

.form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

.form-hint i {
    margin-right: 5px;
    color: var(--info);
}

/* ===== 按钮样式 ===== */
.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-primary {
    padding: 12px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    padding: 12px 24px;
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    padding: 12px 24px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger {
    padding: 12px 24px;
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* ===== 提示信息 ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #1565c0;
}

/* ===== 导航栏 ===== */
.navbar {
    background: white;
    padding: 15px 30px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-800);
}

.navbar-brand i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 24px;
}

.navbar-logo {
    max-height: 32px;
    max-width: 120px;
    object-fit: contain;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--gray-700);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link i {
    margin-right: 5px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--gray-700);
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.admin {
    background: var(--gradient-secondary);
    color: white;
}

.badge.user {
    background: var(--gradient-success);
    color: white;
}

.logout {
    color: var(--danger) !important;
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ===== 卡片样式 ===== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 20px 25px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 18px;
    color: var(--gray-800);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h2 i {
    color: var(--primary);
}

.card-body {
    padding: 25px;
}

/* ===== 查询表单 ===== */
.query-form .form-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.query-form .form-group {
    margin-bottom: 0;
}

.query-form .flex-1 {
    flex: 1;
}

/* ===== 表格样式 ===== */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--gray-100);
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-300);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-100);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* ===== 欢迎卡片 ===== */
.welcome-card {
    text-align: center;
    padding: 60px 40px;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

.welcome-icon i {
    font-size: 56px;
    color: white;
}

.welcome-card h2 {
    font-size: 32px;
    color: var(--gray-800);
    margin-bottom: 15px;
}

.welcome-card p {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 30px;
}

.admin-tips {
    background: #fff3cd;
    border-left: 4px solid var(--warning);
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.admin-tips p {
    color: #856404;
    font-weight: 600;
    margin-bottom: 10px;
}

.admin-tips ul {
    list-style: none;
    padding-left: 0;
}

.admin-tips li {
    padding: 5px 0;
    color: #856404;
}

.admin-tips li i {
    margin-right: 8px;
}

.admin-tips a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.admin-tips a:hover {
    text-decoration: underline;
}

/* ===== 页脚 ===== */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--gray-600);
    font-size: 14px;
    margin-top: 50px;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .navbar {
        flex-direction: row;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .navbar-brand span {
        display: none; /* 手机端隐藏品牌文字 */
    }
    
    .navbar-menu {
        flex-wrap: nowrap;
        gap: 5px;
        justify-content: flex-end;
    }
    
    .navbar-menu .nav-link span {
        display: none; /* 手机端隐藏链接文字 */
    }
    
    .navbar-menu .nav-link i {
        margin: 0; /* 手机端图标居中 */
    }
    
    .navbar-menu .nav-link {
        width: 36px;
        height: 36px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
    }
    
    .user-info {
        display: none; /* 手机端隐藏用户信息 */
    }
    
    .query-form .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .query-form .form-group {
        width: 100%;
        margin-bottom: 0;
    }
    
    .query-form .btn-primary {
        width: 100%;
    }
    
    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .welcome-card {
        padding: 40px 20px;
    }
    
    .welcome-card h2 {
        font-size: 24px;
    }
    
    /* 手机端卡片样式 */
    .result-count {
        font-size: 13px;
        color: var(--gray-600);
        margin-bottom: 10px;
    }
    
    .result-card {
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    
    .result-card .card-field {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 11px 14px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 13px;
        min-height: 42px;
    }
    
    .result-card .card-field:last-child {
        border-bottom: none;
    }
    
    .result-card .card-field .field-label {
        color: var(--gray-500);
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .result-card .card-field .field-value {
        color: var(--gray-800);
        text-align: right;
        word-break: break-all;
        flex: 1;
        margin-left: 12px;
    }
    
    .result-card .card-field-primary {
        background: linear-gradient(135deg, rgba(102,126,234,0.06) 0%, rgba(118,75,162,0.04) 100%);
        padding: 12px 14px;
    }
    
    .result-card .card-field-primary .field-value {
        font-weight: 600;
        color: #333;
        font-size: 14px;
    }
    
    .result-card .card-field-primary .field-label {
        color: #667eea;
        font-weight: 500;
    }
    
    /* 手机端欢迎卡片 */
    .welcome-icon {
        width: 80px;
        height: 80px;
    }
    
    .welcome-icon i {
        font-size: 36px;
    }
    
    /* 手机端页脚 */
    .footer {
        padding: 20px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .login-header h1 {
        font-size: 24px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .result-card .card-field {
        padding: 7px 12px;
        font-size: 12px;
    }
    
    .result-card .card-field .field-label {
        font-size: 11px;
    }
    
    .result-card .card-field-primary .field-value {
        font-size: 13px;
    }
}
