/* 通用样式定义 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo span {
    color: #ffcc00;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    color: #ffcc00;
}

.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.section-title p {
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-col {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-center {
    display: block;
    margin: 2rem auto 0;
    text-align: center;
}

.results-container {
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.dashboard-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.dashboard-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.dashboard-card .label {
    color: #7f8c8d;
    font-size: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 对于只需要单列的页面 */
.dashboard-grid.single-column {
    grid-template-columns: 1fr;
}

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

.panel {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.panel h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f4f8;
}

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

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

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.probability-high {
    color: #e74c3c;
    font-weight: bold;
}

.probability-medium {
    color: #f39c12;
    font-weight: bold;
}

.probability-low {
    color: #27ae60;
    font-weight: bold;
}

.trend-chart {
    height: 300px;
    display: flex;
    align-items: flex-end;
    gap: 5px;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #3498db, #2980b9);
    min-width: 10px;
    border-radius: 5px 5px 0 0;
    position: relative;
    transition: height 0.5s ease;
}

.chart-label {
    position: absolute;
    bottom: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.7rem;
    color: #7f8c8d;
}

.chart-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: #2c3e50;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 5rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }

    .nav-links {
        margin-top: 1rem;
    }

    .nav-links li {
        margin: 0 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .footer-content {
        flex-direction: column;
    }
}

/* 登录页面样式 */
.login-container {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
    margin: 5rem auto;
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.login-subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 1rem;
    display: none;
}

.default-credentials {
    background: #e3f2fd;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #0d47a1;
}

/* 通知样式 */
.notification {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.notification.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.notification.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 统计卡片样式 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.metric-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    border-left: 4px solid #3498db;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3498db;
    margin: 0.5rem 0;
}

.metric-label {
    font-size: 1rem;
    color: #7f8c8d;
}

/* 数据格式部分样式 */
.data-format-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.data-format-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.data-format-section ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.data-format-section li {
    margin-bottom: 0.5rem;
}

.data-format-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-format-section th,
.data-format-section td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.data-format-section th {
    background-color: #e9ecef;
    font-weight: 600;
}

/* 客户详情页面样式 */
.customer-detail-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.customer-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.customer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.info-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.info-value {
    color: #7f8c8d;
}

.prediction-history {
    margin-top: 2rem;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.history-table th,
.history-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.history-table th {
    background-color: #e9ecef;
    font-weight: 600;
}

.btn-back {
    background: #95a5a6;
}

/* 关于页面样式 */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.about-text h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.features-list {
    margin: 1.5rem 0;
}

.feature-item {
    display: flex;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.feature-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feature-icon {
    font-size: 1.5rem;
    color: #3498db;
    margin-right: 1rem;
    min-width: 30px;
}

.feature-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.mission-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.mission-card img {
    width: 100%;
    max-width: 200px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.mission-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.mission-card p {
    color: #7f8c8d;
}

/* 用户管理页面样式 */
.sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    z-index: 1;
    overflow: auto;
    background: #2c3e50;
    color: white;
}

.main-content {
    margin-left: 200px;
    margin-right: 0px;
    margin-top: 0px;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 200px;
    right: 0;
    z-index: 1;
    overflow: auto;
    padding: 8px 8px 0 8px;
    background: #34495e;
    color: white;
}

.page-content {
    margin-top: 60px;
    padding: 16px 16px 16px 16px;
}

.w3-card-4 {
    box-shadow: 0 4px 10px 0 rgba(0,0,0,0.2), 0 4px 20px 0 rgba(0,0,0,0.19);
}

.user-form-container {
    max-width: 500px;
    margin: 20px 0;
}

/* 日历样式 */
.calendar-container {
    padding: 1rem;
}

.calendar {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.calendar-header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 1rem;
    text-align: center;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8f9fa;
    font-weight: bold;
    text-align: center;
}

.weekdays div {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #eee;
}

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #eee;
}

.day {
    background: white;
    min-height: 80px;
    padding: 0.5rem;
    position: relative;
    transition: background-color 0.2s;
}

.day:hover {
    background-color: #f0f8ff;
}

.outside-month {
    background: #f8f9fa;
    color: #aaa;
}

.today {
    background-color: #e3f2fd;
    border: 2px solid #2196f3;
}

.date {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.8rem;
    font-weight: bold;
}

.prediction-data {
    margin-top: 1rem;
    text-align: center;
}

.prediction-count {
    font-size: 0.8rem;
    color: #666;
}

.avg-prob {
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    display: inline-block;
    margin-top: 0.2rem;
}

.low-prob {
    background-color: #d4edda;
    color: #155724;
}

.medium-prob {
    background-color: #fff3cd;
    color: #856404;
}

.high-prob {
    background-color: #f8d7da;
    color: #721c24;
}

/* 结果展示样式 */
.result-summary {
    margin-bottom: 2rem;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.gradient-purple {
    background: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    color: white;
}

.gradient-green {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.stat-header i {
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

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

.prediction-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.prediction-icon {
    font-size: 2.5rem;
}

.result-details {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.result-details h3,
.result-details h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-summary,
.recommendation {
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.summary-item .label {
    font-weight: 600;
    color: #7f8c8d;
}

.summary-item .value {
    color: #2c3e50;
}

.rec-text {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

/* 开发参考页面样式 */
.reference-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.reference-section {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.reference-section:last-child {
    border-bottom: none;
}

.reference-section h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-section h4 {
    color: #3498db;
    margin: 1.2rem 0 0.8rem;
    font-size: 1.2rem;
}

.sql-query {
    background: #2b2b2b;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.data-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.data-flow-item {
    flex: 1;
    min-width: 200px;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.data-flow-item h5 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.data-flow-item p {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.calculation-example {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.calculation-example p {
    margin: 0.5rem 0;
}

.variable-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.variable-table th,
.variable-table td {
    border: 1px solid #ddd;
    padding: 0.75rem;
    text-align: left;
}

.variable-table th {
    background-color: #e9ecef;
    font-weight: 600;
}