/* Base Template Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Navigation Bar */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    font-size: 18px;
}

.navbar-brand img {
    height: 32px;
    margin-right: 8px;
}

.navbar-title {
    color: #1976d2;
}

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

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #1976d2;
    background-color: #f5f5f5;
}

/* User Section */
.user-section {
    display: flex;
    align-items: center;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

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

.user-welcome {
    color: #333;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background: #1976d2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
}

.btn-primary:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* Auth Dialog */
.auth-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.auth-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.auth-close:hover {
    background: #f5f5f5;
    color: #333;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: #666;
    font-size: 14px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
}

.auth-tab:hover {
    color: #1976d2;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.phone-input-group {
    display: flex;
    gap: 8px;
}

.phone-input {
    flex: 1;
}

.verify-btn {
    background: #1976d2;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.verify-btn:hover:not(:disabled) {
    background: #1565c0;
}

.verify-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.agreement {
    margin: 20px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s;
}

.checkbox-input:checked + .checkbox-custom {
    background: #1976d2;
    border-color: #1976d2;
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.agreement-text {
    color: #666;
}

.agreement-link {
    color: #1976d2;
    text-decoration: none;
}

.agreement-link:hover {
    text-decoration: underline;
}

.auth-submit-btn {
    width: 100%;
    background: #1976d2;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-submit-btn:hover {
    background: #1565c0;
}

/* Message Toast */
.message-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 3000;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.message-toast.success {
    background: #4caf50;
}

.message-toast.error {
    background: #f44336;
}

.message-toast.warning {
    background: #ff9800;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
        height: auto;
        min-height: 64px;
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .navbar-nav {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    
    .auth-card {
        margin: 20px;
        padding: 24px;
    }
    
    .phone-input-group {
        flex-direction: column;
    }
    
    .verify-btn {
        width: 100%;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .navbar-brand {
        font-size: 16px;
    }
    
    .navbar-brand img {
        height: 28px;
    }
    
    .nav-link {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .btn-primary {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .auth-title {
        font-size: 20px;
    }
}

.nested-table {
  font-weight: 400 !important;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 13px;
  border-collapse: collapse;
  width: auto;
  margin: 1em 0;
  background-color: #ffffff;
  border-top: 1px solid #cccccc;
  border-bottom: 1px solid #cccccc;
}

.nested-table thead th {
  background-color: #ffffff;
  border-top: 1px solid #cccccc;
  border-bottom: 1px solid #cccccc;
  padding: 4px 8px;
  text-align: center;
  color: #333333;
}

.nested-table tbody td {
  padding: 4px 8px;
  text-align: center;
  min-width: 80px;
}

.nested-table tbody tr th {
  border-right: 1px solid #cccccc;
}

.nested-table tbody td:first-child {
  text-align: left;
  background-color: #f9f9f9;
  border-right: 2px solid #cccccc;
}

/* 星号标记样式 */
.nested-table .stata-star {
  color: #c00;
  margin-left: 2px;
}

/* 结果行样式 */
.nested-table .result-row td {
  background-color: #ffffe0;
  border-top: 2px solid #cccccc;
}

/* 注释行样式 */
.nested-table .note-row td {
  font-size: 11px;
  color: #666;
  padding-top: 6px;
}

th {
  font-weight: 400 !important;
  white-space: nowrap;
}