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

.topbar { background: #1a1f2e; color: #fff; width: 100%; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; height: 44px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn { display: inline-block; padding: 5px 14px; border-radius: 5px; font-size: 0.82rem; font-weight: 500; text-decoration: none; background: rgba(255,255,255,0.1); color: #e2e8f0; transition: all 0.2s; }
.topbar-btn:hover { background: rgba(255,255,255,0.22); color: #fff; }
.lang-select {
  padding: 4px 20px 4px 10px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px;
  background-color: rgba(255,255,255,0.12);
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e2e8f0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 10px;
  color: #e2e8f0;
  font-size: 0.82rem;
  cursor: pointer;
  min-width: 120px;
}

.lang-select option {
  background-color: #1a1f2e;
  color: #e2e8f0;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.header { background: linear-gradient(135deg, #6b3a5c 0%, #8a4a6e 100%); color: #fff; padding: 28px 0 22px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.header h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: 0.5px; }
.header .subtitle { font-size: 0.95rem; opacity: 0.85; margin-top: 6px; }

.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 16px 20px 0; max-width: 1100px; margin: 0 auto; }
.tab-btn { padding: 10px 20px; border: none; background: #e2e8f0; color: #555; font-size: 0.9rem; font-weight: 500; border-radius: 8px 8px 0 0; cursor: pointer; transition: all 0.2s; }
.tab-btn:hover { background: #cbd5e0; color: #2d3748; }
.tab-btn.active { background: #fff; color: #6b3a5c; font-weight: 600; box-shadow: 0 -2px 8px rgba(0,0,0,0.06); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px 40px; }
.calculator { display: none; background: #fff; border-radius: 0 0 12px 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 32px; animation: fadein 0.3s ease; }
.calculator.active { display: block; }

@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.calc-title { font-size: 1.3rem; color: #6b3a5c; margin-bottom: 6px; font-weight: 700; }
.calc-desc { color: #666; font-size: 0.9rem; margin-bottom: 24px; line-height: 1.5; }

.formula-box { background: #faf5f8; border-left: 4px solid #8a4a6e; padding: 12px 16px; margin-bottom: 20px; font-family: "Courier New", monospace; font-size: 0.92rem; color: #4a2d3d; border-radius: 0 6px 6px 0; white-space: pre-wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .tabs { gap: 2px; } .tab-btn { padding: 8px 14px; font-size: 0.82rem; } .calculator { padding: 20px 16px; } }

.input-group { display: flex; flex-direction: column; gap: 4px; }
.input-group label { font-size: 0.85rem; font-weight: 500; color: #4a5568; }
.input-group label .limit { font-weight: 400; color: #a0aec0; font-size: 0.78rem; }
.input-group input, .input-group select { padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s; width: 100%; }
.input-group input:focus, .input-group select:focus { outline: none; border-color: #8a4a6e; box-shadow: 0 0 0 3px rgba(138,74,110,0.15); }

.btn-calc { background: linear-gradient(135deg, #8a4a6e 0%, #6b3a5c 100%); color: #fff; border: none; padding: 12px 32px; font-size: 1rem; font-weight: 600; border-radius: 8px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; margin-top: 20px; }
.btn-calc:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(107,58,92,0.3); }
.btn-calc:active { transform: translateY(0); }

.result { margin-top: 24px; padding: 20px; border-radius: 10px; display: none; }
.result.show { display: block; animation: fadein 0.3s ease; }
.result.pass { background: #f0fff4; border: 1px solid #c6f6d5; }
.result.fail { background: #fff5f5; border: 1px solid #fed7d7; }
.result.info { background: #ebf4ff; border: 1px solid #bee3f8; }

.result-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.result.pass .result-title { color: #276749; }
.result.fail .result-title { color: #c53030; }
.result.info .result-title { color: #3a5278; }
.result-detail { font-size: 0.9rem; color: #4a5568; line-height: 1.7; }
.result-detail .val { font-weight: 600; }

.y-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 0.85rem; }
.y-table th { background: #faf5f8; border: 1.5px solid #e8d5e0; padding: 8px 10px; text-align: center; font-weight: 600; color: #4a2d3d; }
.y-table td { border: 1.5px solid #e8d5e0; padding: 8px 10px; text-align: center; }
.y-table tr:nth-child(even) td { background: #fdfafc; }
.y-table .highlight { background: #fcedf3 !important; font-weight: 700; color: #6b3a5c; }

.footer { text-align: center; padding: 20px; color: #a0aec0; font-size: 0.8rem; }
