/**
 * 艾舟绿能项目报备管理系统 - 样式表
 */

:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --orange: #ea580c;
    --purple: #7c3aed;
    --cyan: #0891b2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

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

.login-header h1 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}

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

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
}

.login-footer .hint {
    font-size: 12px;
    margin-top: 6px;
    opacity: 0.8;
}

/* App Layout */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-btn:hover { background: var(--gray-200); }

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    color: var(--gray-500);
}

/* Notification Panel */
.notif-panel {
    position: fixed;
    top: 64px;
    right: 20px;
    width: 360px;
    max-height: 480px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    display: none;
}

.notif-panel.show { display: block; }

.notif-header {
    padding: 14px 16px;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h3 { font-size: 14px; }

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #eff6ff; border-left: 3px solid var(--primary); }

.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.notif-content { font-size: 12px; color: var(--gray-600); }
.notif-time { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info { flex: 1; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label { font-size: 12px; color: var(--gray-500); }

.stat-blue .stat-icon { background: #dbeafe; }
.stat-blue .stat-value { color: #1e40af; }
.stat-yellow .stat-icon { background: #fef3c7; }
.stat-yellow .stat-value { color: #92400e; }
.stat-green .stat-icon { background: #d1fae5; }
.stat-green .stat-value { color: #065f46; }
.stat-purple .stat-icon { background: #ede9fe; }
.stat-purple .stat-value { color: #5b21b6; }
.stat-orange .stat-icon { background: #ffedd5; }
.stat-orange .stat-value { color: #c2410c; }
.stat-red .stat-icon { background: #fee2e2; }
.stat-red .stat-value { color: #991b1b; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.tab:hover { color: var(--primary); }
.tab.active { background: white; color: var(--primary); box-shadow: var(--shadow); }

/* Card */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

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

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

.card-header h2::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.btn-group { display: flex; gap: 10px; }

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-input {
    padding: 8px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    min-width: 200px;
    flex: 1;
    max-width: 300px;
}

.filter-input:focus { outline: none; border-color: var(--primary); }

.filter-select {
    padding: 8px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    background: white;
    min-width: 140px;
}

.filter-select:focus { outline: none; border-color: var(--primary); }

/* Table */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th, td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    position: sticky;
    top: 0;
}

tr:hover { background: var(--gray-50); }
tr.row-warning { background: #fffbeb; }
tr.row-danger { background: #fef2f2; }

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-pink { background: #fce7f3; color: #9d174d; }
.badge-cyan { background: #cffafe; color: #0e7490; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-orange { background: #ffedd5; color: #c2410c; }

/* Action Buttons */
.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin: 2px;
    transition: all 0.2s;
}

.action-btn.primary { background: #dbeafe; color: #1e40af; }
.action-btn.success { background: #d1fae5; color: #065f46; }
.action-btn.warning { background: #fef3c7; color: #92400e; }
.action-btn.danger { background: #fee2e2; color: #991b1b; }
.action-btn:hover { opacity: 0.8; }

/* Form */
.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 24px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.form-group.full { grid-column: 1 / -1; }

.warning-group input {
    border-color: var(--warning) !important;
    background: #fffbeb;
    padding-right: 120px;
}

.conflict-tip {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--warning);
    font-weight: 600;
}

.protect-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--warning);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #92400e;
}

.notice-icon { font-size: 20px; }

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 12px;
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.chart-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 16px;
}

.bar-chart { display: flex; flex-direction: column; gap: 10px; }

.bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    width: 70px;
    font-size: 12px;
    color: var(--gray-600);
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 24px;
    background: var(--gray-100);
    border-radius: 12px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    min-width: 30px;
}

.bar-fill.blue { background: var(--primary); }
.bar-fill.green { background: var(--success); }
.bar-fill.yellow { background: var(--warning); }
.bar-fill.purple { background: var(--purple); }
.bar-fill.orange { background: var(--orange); }
.bar-fill.cyan { background: var(--cyan); }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 2px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover { background: var(--gray-200); }

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Approval Flow */
.approval-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.approval-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    background: white;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    min-width: 80px;
}

.approval-step.active { background: var(--primary); color: white; }
.approval-step.approved { background: var(--success); color: white; }
.approval-step.pending { background: var(--gray-200); color: var(--gray-600); }
.approval-step small { font-weight: normal; font-size: 10px; opacity: 0.8; }

.approval-arrow { color: var(--gray-400); font-size: 18px; }

/* Timeline */
.timeline { padding: 10px 0; }

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 30px;
    bottom: -12px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-item.success .timeline-dot { background: var(--success); }
.timeline-item.pending .timeline-dot { background: var(--gray-400); }
.timeline-item.reject .timeline-dot { background: var(--danger); }

.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-time { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.timeline-desc { font-size: 12px; color: var(--gray-600); margin-top: 4px; }

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--gray-900);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }

/* 注册申请链接 */
.register-link { margin-top: 12px; font-size: 13px; }
.register-link a { color: var(--primary); text-decoration: none; cursor: pointer; }
.register-link a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
    .header { padding: 0 16px; }
    .header h1 { font-size: 15px; }
    .user-details { display: none; }
    .main-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .modal { max-width: 100%; margin: 10px; }
    .notif-panel { width: calc(100% - 40px); right: 20px; left: 20px; }
    .filters { flex-direction: column; }

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.chart-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 100px;
    font-size: 13px;
    color: var(--gray-700);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 20px;
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.bar-value {
    width: 80px;
    font-size: 13px;
    font-weight: 600;
    text-align: right;
    color: var(--gray-800);
}
    .filter-input, .filter-select { width: 100%; max-width: none; }
}