* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    background: #0d1117;
    color: #e6edf3;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 14px 30px;
}

.home-container {
    max-width: 960px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.home-hero {
    text-align: center;
}

.home-link-button {
    display: inline-block;
    margin-top: 14px;
    border: 0;
    background: #0c66e4;
    color: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
}

.home-link-button:hover {
    background: #1f6feb;
}

.home-feature-list ul {
    margin: 0;
    padding-left: 20px;
    color: #b4c4d4;
}

.home-feature-list li {
    margin: 8px 0;
}

.top-nav {
    margin: 0 0 12px;
}

.home-back-link {
    color: #8b9db0;
    text-decoration: none;
    font-size: 14px;
}

.home-back-link:hover {
    color: #b4c4d4;
}

h1 {
    margin: 0 0 8px;
    font-size: 28px;
}

.hint {
    margin: 0 0 16px;
    color: #9fb0c3;
}

.query-form {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.event-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 0 0 10px;
}

.view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: #b4c4d4;
}

.event-range-controls {
    flex-wrap: wrap;
}

.event-date-input {
    border: 1px solid #364152;
    border-radius: 8px;
    padding: 8px 10px;
    background: #111827;
    color: #e6edf3;
}

.secondary-button {
    border: 1px solid #364152;
    background: #111827;
    color: #c7d2e0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.secondary-button:hover {
    border-color: #4b5a70;
}

.toggle-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #b4c4d4;
    font-size: 14px;
}

.toggle-item input {
    width: 16px;
    height: 16px;
}

#stock-input {
    flex: 1;
    border: 1px solid #364152;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
    background: #111827;
    color: #e6edf3;
}

#stock-input::placeholder {
    color: #8b9db0;
}

.history-range {
    border: 1px solid #364152;
    border-radius: 8px;
    padding: 10px 10px;
    background: #111827;
    color: #e6edf3;
    font-size: 14px;
}

#query-button {
    border: 0;
    background: #0c66e4;
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
}

#query-button:disabled {
    background: #7fa8ec;
    cursor: not-allowed;
}

.status {
    min-height: 24px;
    margin: 0 0 12px;
    color: #b4c4d4;
}

.selected-stock {
    min-height: 22px;
    margin: 0 0 6px;
    color: #e6edf3;
    font-weight: 600;
}

.status.error {
    color: #c9372c;
}

.chart-card {
    background: #111827;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid #223046;
}

.chart-card h2 {
    margin: 0 0 10px;
    font-size: 18px;
}

.analysis-card {
    margin-bottom: 14px;
}

.analysis-recommendation {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #f8fafc;
}

.analysis-recommendation.buy {
    color: #22c55e;
}

.analysis-recommendation.hold {
    color: #facc15;
}

.analysis-recommendation.sell {
    color: #f87171;
}

.analysis-score {
    margin: 0 0 8px;
    color: #b4c4d4;
}

.analysis-signals {
    margin: 0;
    padding-left: 18px;
    color: #b4c4d4;
}

.analysis-signals li {
    margin: 4px 0;
}

.analysis-note {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 13px;
}

.chart {
    width: 100%;
    height: 100%;
}

.chart-resizable {
    width: 100%;
    height: min(68vh, 760px);
    min-height: 420px;
    resize: vertical;
    overflow: hidden;
    border: 1px solid #223046;
    border-radius: 8px;
}

.chart-card.hidden {
    display: none;
}

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

.event-history-block h3 {
    margin: 0 0 8px;
    font-size: 15px;
    color: #d1d9e0;
}

.event-history-list {
    margin: 0;
    padding-left: 18px;
    color: #b4c4d4;
    max-height: 220px;
    overflow: auto;
}

.event-history-list li {
    margin: 4px 0;
    font-size: 14px;
}
