* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
    background: #0a0e1a;
    color: #e0e6ed;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #1e2a3a;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-left h1 {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #00d4ff, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #8892a4;
    font-size: 0.9rem;
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.last-update {
    font-size: 0.8rem;
    color: #8892a4;
}

.btn-admin {
    display: inline-block;
    padding: 8px 16px;
    background: #1e2a3a;
    color: #e0e6ed;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-admin:hover {
    background: #2a3a4e;
}

/* Signal Panel */
.signal-panel {
    background: linear-gradient(135deg, #141a2e, #1a2238);
    border: 1px solid #1e2a3a;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    margin-bottom: 30px;
}

.signal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.signal-header h2 {
    font-size: 1.4rem;
}

.signal-badge {
    display: inline-block;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: bold;
}

.signal-badge.strong-positive {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
    border: 1px solid #00c853;
}

.signal-badge.positive {
    background: rgba(0, 200, 83, 0.1);
    color: #69f0ae;
    border: 1px solid #69f0ae;
}

.signal-badge.neutral {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.signal-badge.negative {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    border: 1px solid #ff5252;
}

.signal-badge.strong-negative {
    background: rgba(255, 0, 0, 0.2);
    color: #ff1744;
    border: 1px solid #ff1744;
}

.signal-score {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.signal-desc {
    color: #8892a4;
    font-size: 1rem;
}

/* Pillars */
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.pillar-card {
    background: #141a2e;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s;
}

.pillar-card:hover {
    transform: translateY(-2px);
}

.pillar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pillar-header h3 {
    font-size: 1.1rem;
}

.pillar-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(123, 47, 247, 0.15);
    color: #b388ff;
    border: 1px solid rgba(123, 47, 247, 0.3);
}

.pillar-indicator {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.pillar-indicator.positive {
    color: #00c853;
}

.pillar-indicator.neutral {
    color: #ffc107;
}

.pillar-indicator.negative {
    color: #ff5252;
}

.pillar-data {
    margin-bottom: 15px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.data-row .label {
    color: #8892a4;
}

.data-row .value.positive {
    color: #69f0ae;
}

.data-row .value.negative {
    color: #ff5252;
}

.pillar-warning {
    text-align: center;
    margin-bottom: 10px;
}

.pillar-warning .warning-msg {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border-radius: 8px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 82, 82, 0.3);
    animation: pulse 2s infinite;
}

.pillar-interpretation {
    font-size: 0.85rem;
    color: #8892a4;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.pillar-interpretation strong {
    color: #e0e6ed;
}

/* Charts */
.charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: #141a2e;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    padding: 20px;
}

.chart-container h3 {
    margin-bottom: 15px;
    font-size: 1rem;
}

.chart-container canvas {
    width: 100% !important;
    max-height: 300px;
}

/* Schedule */
.schedule {
    background: #141a2e;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.schedule h3 {
    margin-bottom: 20px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
}

.schedule-icon {
    font-size: 1.5rem;
}

.schedule-info strong {
    display: block;
    margin-bottom: 3px;
}

.schedule-info span {
    font-size: 0.85rem;
    color: #8892a4;
}

/* References */
.references {
    background: #141a2e;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.references h3 {
    margin-bottom: 15px;
}

.references ul {
    list-style: none;
}

.references li {
    margin-bottom: 8px;
}

.references a {
    color: #64b5f6;
    text-decoration: none;
}

.references a:hover {
    text-decoration: underline;
}

/* Admin Styles */
.admin-section {
    background: #141a2e;
    border: 1px solid #1e2a3a;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.admin-section h2 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    color: #8892a4;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    padding: 10px;
    background: #1a2238;
    border: 1px solid #2a3a4e;
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 0.9rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #7b2ff7;
}

.btn-submit {
    padding: 10px 24px;
    background: linear-gradient(135deg, #7b2ff7, #00d4ff);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn-submit:hover {
    opacity: 0.9;
}

.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #00c853, #69f0ae);
    color: #0a0e1a;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-delete {
    padding: 5px 10px;
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background: rgba(255, 82, 82, 0.3);
}

.quick-actions {
    margin-bottom: 25px;
    text-align: center;
}

.calc-result {
    margin-top: 15px;
}

.calc-result .success {
    padding: 10px;
    background: rgba(0, 200, 83, 0.1);
    border: 1px solid rgba(0, 200, 83, 0.3);
    border-radius: 8px;
    color: #69f0ae;
}

.calc-result .error {
    padding: 10px;
    background: rgba(255, 82, 82, 0.1);
    border: 1px solid rgba(255, 82, 82, 0.3);
    border-radius: 8px;
    color: #ff5252;
}

/* Data Tables */
.data-table-container {
    margin-top: 20px;
}

.data-table-container h4 {
    margin-bottom: 10px;
    color: #8892a4;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: rgba(255,255,255,0.03);
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    color: #8892a4;
    font-weight: 500;
}

.warning-row {
    background: rgba(255, 82, 82, 0.05);
}

td.positive {
    color: #69f0ae;
}

td.negative {
    color: #ff5252;
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Responsive */
@media (max-width: 1024px) {
    .pillars {
        grid-template-columns: 1fr;
    }
    .charts {
        grid-template-columns: 1fr;
    }
    .schedule-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    .header-left h1 {
        font-size: 1.4rem;
    }
}