/* ChanYuan v5 Web — Dark Theme */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
       background: #0d1018; color: #e4e7ee; line-height: 1.5; }

/* Login */
.login-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: #1a1d2e; border-radius: 12px; padding: 40px; border: 1px solid #2a2d3e;
              width: 100%; max-width: 400px; text-align: center; }
.login-card h1 { font-size: 1.4rem; color: #7c9ef8; margin-bottom: 8px; }
.login-card input { width: 100%; padding: 12px; margin: 8px 0; background: #14172a; border: 1px solid #2a2d3e;
                    border-radius: 8px; color: #e4e7ee; font-size: 0.95rem; }
.login-card input:focus { outline: none; border-color: #7c9ef8; }

/* Layout */
header { background: linear-gradient(90deg, #1a1d2e, #1e2540); padding: 12px 24px;
         display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #2a2d3e; }
header h1 { font-size: 1.2rem; color: #7c9ef8; }
.badge { background: #2a3a5c; color: #7c9ef8; padding: 2px 10px; border-radius: 12px; font-size: 0.7rem; }
.ticker-bar { display: flex; gap: 24px; padding: 8px 24px; background: #14172a;
              border-bottom: 1px solid #2a2d3e; overflow-x: auto; font-size: 0.82rem; white-space: nowrap; }
.ticker-item { display: flex; align-items: center; gap: 8px; }
.up { color: #f44336; } .down { color: #4caf50; }

nav { background: #14172a; padding: 0 24px; display: flex; gap: 2px; overflow-x: auto;
      border-bottom: 1px solid #2a2d3e; position: sticky; top: 0; z-index: 50; }
nav button { background: transparent; border: none; color: #888; padding: 11px 16px;
             cursor: pointer; font-size: 0.85rem; border-bottom: 2px solid transparent;
             white-space: nowrap; transition: all 0.2s; }
nav button:hover { color: #ccc; }
nav button.active { color: #7c9ef8; border-bottom-color: #7c9ef8; }

main { padding: 20px; max-width: 1600px; margin: 0 auto; }
.tab { display: none; animation: fadeIn 0.3s; }
.tab.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Grid */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Cards */
.card { background: #1a1d2e; border-radius: 10px; padding: 18px; border: 1px solid #2a2d3e; }
.card h2 { font-size: 0.82rem; color: #888; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .icon { width: 5px; height: 12px; background: #7c9ef8; border-radius: 3px; display: inline-block; }
.stat { font-size: 1.8rem; font-weight: 700; color: #7c9ef8; }
.stat-sub { font-size: 0.78rem; color: #666; margin-top: 4px; }

/* Buttons */
.btn-primary { background: #7c9ef8; color: #0d1018; border: none; padding: 12px 32px; border-radius: 8px;
               cursor: pointer; font-size: 0.95rem; font-weight: 600; width: 100%; margin-top: 8px; }
.btn-primary:hover { background: #6b8de8; }
.btn-sm { background: #2a3a5c; color: #7c9ef8; border: none; padding: 6px 14px; border-radius: 6px;
          cursor: pointer; font-size: 0.8rem; }
.btn-sm:hover { background: #3a4a6c; }
.btn-danger { background: #5c2a2a; color: #f44336; }
.btn-danger:hover { background: #6c3a3a; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
th { text-align: left; padding: 10px 12px; color: #888; border-bottom: 1px solid #2a2d3e; font-weight: 500;
     font-size: 0.78rem; text-transform: uppercase; }
td { padding: 10px 12px; border-bottom: 1px solid #1f2233; }
tr:hover { background: #1f2233; }

/* Inputs & Selects */
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
select, textarea { background: #14172a; border: 1px solid #2a2d3e; border-radius: 6px;
                   color: #e4e7ee; padding: 8px 12px; font-size: 0.88rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #7c9ef8; }
select { cursor: pointer; }

/* Sliders */
input[type="range"] { -webkit-appearance: none; width: 100%; height: 6px; background: #2a2d3e;
                      border-radius: 3px; outline: none; margin: 8px 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px;
    background: #7c9ef8; border-radius: 50%; cursor: pointer; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { min-width: 120px; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
                 align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }
.modal { background: #1a1d2e; border-radius: 12px; padding: 24px; border: 1px solid #2a2d3e;
         max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; }
.modal h3 { color: #7c9ef8; margin-bottom: 16px; }

/* Progress */
.progress-bar { height: 6px; background: #2a2d3e; border-radius: 3px; overflow: hidden; margin: 8px 0; }
.progress-fill { height: 100%; background: #7c9ef8; border-radius: 3px; transition: width 0.3s; width: 0%; }

/* Responsive */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  nav { gap: 0; } nav button { padding: 10px 12px; font-size: 0.78rem; }
  header { padding: 10px 16px; } main { padding: 12px; }
}
