/* QSL 通联记录系统 - 样式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* 顶部导航 */
.navbar {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-brand .icon {
    font-size: 1.6rem;
}

.navbar-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-logout {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #2c5282;
}

.stat-card .stat-label {
    color: #718096;
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.stat-card.blue { border-top: 4px solid #3182ce; }
.stat-card.green { border-top: 4px solid #38a169; }
.stat-card.orange { border-top: 4px solid #dd6b20; }
.stat-card.purple { border-top: 4px solid #805ad5; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #3182ce;
    color: white;
}

.btn-primary:hover {
    background: #2c5282;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #4a5568;
}

.btn-outline:hover {
    background: #f7fafc;
    border-color: #a0aec0;
}

.btn-sm {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

tbody tr:hover {
    background: #f7fafc;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background: #fefcbf;
    color: #744210;
}

.status-sent {
    background: #bee3f8;
    color: #2a4365;
}

.status-received {
    background: #c6f6d5;
    color: #22543d;
}

.status-confirmed {
    background: #d6bcfa;
    color: #44337a;
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.search-bar .form-control {
    flex: 1;
    min-width: 200px;
}

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #718096;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.login-card .brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .brand-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-card h1 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.login-card .brand-sub {
    color: #718096;
    font-size: 0.9rem;
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.success-message {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* 验证页面 */
.verify-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    padding: 1rem;
}

.verify-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
}

.verify-card h2 {
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.verify-card .subtitle {
    color: #718096;
    margin-bottom: 1.5rem;
}

.nfc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #805ad5, #3182ce);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

/* 详情页信息 */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    padding: 0.8rem;
    background: #f7fafc;
    border-radius: 8px;
}

.detail-item .label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 0.25rem;
}

.detail-item .value {
    font-weight: 500;
    color: #2d3748;
    word-break: break-all;
}

/* NFC URL 显示 */
.nfc-url-box {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.nfc-url-box .url-text {
    font-family: monospace;
    font-size: 0.85rem;
    color: #2c5282;
    word-break: break-all;
    margin-bottom: 0.8rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 1.5rem;
}

.page-link {
    padding: 0.5rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #4a5568;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-link:hover, .page-link.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* 类型标签 */
.type-badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
}

.type-electronic {
    background: #bee3f8;
    color: #2a4365;
}

.type-physical {
    background: #feebc8;
    color: #7b341e;
}

.type-nfc {
    background: #e9d8fd;
    color: #44337a;
}

/* 响应式 */
@media (max-width: 768px) {
    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .navbar-inner {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* QSL 卡片预览 */
.qsl-card-preview {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.qsl-card-preview .callsign {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.qsl-card-preview .info-line {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.2rem 0;
}
