* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f5f5; min-height: 100vh; font-size: 14px; }

/* --- Layout: sidebar + main --- */
.layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 160px;
    flex-shrink: 0;
    background: #333;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}
.sidebar-logo {
    padding: 16px 20px;
    border-bottom: 1px solid #444;
}
.sidebar-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}
.sidebar-nav {
    list-style: none;
    padding: 8px 0;
}
.sidebar-nav li { margin: 0; }
.sidebar-nav a {
    display: block;
    padding: 10px 20px;
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s;
}
.sidebar-nav a:hover {
    background: #444;
    color: #fff;
}
.sidebar-nav a.active {
    background: #4a90d9;
    color: #fff;
}
.nav-icon {
    font-family: monospace;
    font-size: 11px;
    margin-right: 6px;
    color: #888;
}
.sidebar-nav a.active .nav-icon { color: #fff; }

/* --- Main --- */
.main {
    margin-left: 160px;
    flex: 1;
    padding: 20px 24px;
    max-width: 100%;
}

/* --- Common --- */
h1 { color: #333; margin-bottom: 16px; font-size: 20px; }
.card { background: white; border-radius: 0; box-shadow: 0 1px 4px rgba(0,0,0,0.08); padding: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 12px; }
label { display: block; margin-bottom: 4px; font-weight: 500; color: #333; font-size: 13px; }
input[type="text"], input[type="number"], input[type="date"], select { width: 100%; padding: 7px 10px; border: 1px solid #ccc; border-radius: 0; font-size: 13px; height: 32px; }
input[type="text"]:focus, input[type="number"]:focus, input[type="date"]:focus, select:focus { outline: none; border-color: #4a90d9; box-shadow: 0 0 0 1px rgba(74,144,217,0.3); }
.btn { padding: 0 14px; border: none; border-radius: 0; cursor: pointer; font-size: 13px; height: 32px; line-height: 32px; margin-right: 6px; display: inline-block; vertical-align: middle; }
.btn-primary { background: #4a90d9; color: white; }
.btn-primary:hover { background: #357abd; }
.btn-secondary { background: #95a5a6; color: white; }
.btn-secondary:hover { background: #7f8c8d; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #219a52; }
.btn-sync { background: #9b59b6; color: white; }
.btn-sync:hover { background: #8e44ad; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.alert { padding: 10px 14px; border-radius: 0; margin-bottom: 12px; font-size: 13px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.help-text { font-size: 12px; color: #888; margin-top: 3px; }
.actions { display: flex; justify-content: flex-start; margin-top: 16px; }

/* 股票搜索下拉框（共用） */
.stock-input-wrapper { position: relative; }
.stock-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #ddd; border-radius: 0; max-height: 200px; overflow-y: auto; z-index: 1000; display: none; }
.stock-dropdown.show { display: block; }
.stock-option { padding: 7px 10px; cursor: pointer; display: flex; justify-content: space-between; font-size: 13px; }
.stock-option:hover { background: #f0f0f0; }
.stock-option .code { color: #333; font-weight: 500; }
.stock-option .name { color: #666; }

@media (max-width: 768px) {
    .sidebar { width: 48px; }
    .sidebar-logo { padding: 12px 8px; text-align: center; }
    .sidebar-logo a { font-size: 14px; }
    .sidebar-nav a { padding: 10px 8px; font-size: 0; }
    .sidebar-nav a .nav-icon { font-size: 14px; margin: 0; }
    .main { margin-left: 48px; padding: 12px; }
}
