﻿/* ====================================
   NYCU.cc Domain hosting - Stylesheet
   Modern Light Theme
   ==================================== */

:root {
  --primary: #2185d0;
  --primary-hover: #1a69b0;
  --primary-light: #e8f4fd;
  --bg: #ffffff;
  --bg-body: #f4f5f7;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --text: #212529;
  --text-muted: #6c757d;
  --text-dim: #adb5bd;
  --border: #dee2e6;
  --success: #198754;
  --error: #dc3545;
  --error-bg: #fff5f5;
  --warning: #f59e0b;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --nav-height: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Lato, 'Helvetica Neue', Arial, Helvetica, 'Noto Sans TC', sans-serif;
  background: var(--bg-body);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  padding-top: var(--nav-height);
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* ====================================
   Navbar
   ==================================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;        /* centre the .nav-inner */
  padding: 0;                     /* padding handled by .nav-inner */
  background: #2185d0;
  height: var(--nav-height);
  /* Semantic UI top-fixed style */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  margin: 0;
  z-index: 101;
  border-radius: 0;
  box-shadow: 0 1px 2px 0 rgba(34,36,38,0.15);
  border: 0 solid transparent;
  font-family: Lato, 'Helvetica Neue', Arial, Helvetica, 'Noto Sans TC', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  min-height: var(--nav-height);
}

/* Responsive inner container — Semantic UI breakpoints */
.nav-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--nav-height);
  padding: 0 1rem;
  margin: 0 auto;
}

@media (min-width: 1200px) {
  .nav-inner { width: 1127px; padding: 0; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .nav-inner { width: 933px; padding: 0; }
}
@media (min-width: 769px) and (max-width: 991px) {
  .nav-inner { width: 723px; padding: 0; }
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
  padding-right: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-brand:hover {
  color: #ffffff;
}

.logo {
  font-size: 1.35rem;
  line-height: 1;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius);
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav menu — wrapper for links + actions */
.nav-menu {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 0.9rem;
  height: var(--nav-height);
  color: rgba(255,255,255,0.85);
  transition: background var(--transition), color var(--transition);
  font-size: 0.9rem;
  font-weight: 400;
  white-space: nowrap;
  border-radius: 0;
  line-height: 1;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(0,0,0,0.08);
}

/* active class kept in JS but intentionally unstyled */
.nav-link.active {
  color: rgba(255,255,255,0.85);
  background: transparent;
  font-weight: 400;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

#user-greeting {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 400;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ====================================
   Buttons
   ==================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.4rem;
  line-height: 1.4;
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

/* White button for use on the blue navbar */
.btn-light {
  background: #ffffff;
  color: var(--primary);
  border-color: #ffffff;
}

.btn-light:hover {
  background: #f0f4f8;
  border-color: #f0f4f8;
  color: var(--primary-hover);
}

/* Outline white button for navbar */
.btn-outline-light {
  background: transparent;
  border-color: rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.9);
}

.btn-outline-light:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.9);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ====================================
   Container & Pages
   ==================================== */
.container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  flex: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* ====================================
   Hero Section
   ==================================== */
.hero {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.domain-preview {
  margin-bottom: 2rem;
}

.preview-text {
  font-size: 1.4rem;
  font-family: 'Consolas', 'Courier New', monospace;
  background: var(--primary-light);
  color: var(--text);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid #cce0f5;
  display: inline-block;
}

.highlight {
  color: var(--primary);
  font-weight: 700;
}

/* ====================================
   Check Domain
   ==================================== */
.check-domain {
  max-width: 560px;
  margin: 0 auto;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33,133,208,0.12);
}

.input-group input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  min-width: 0;
}

.input-group input::placeholder {
  color: var(--text-dim);
}

.input-suffix {
  color: var(--text-muted);
  padding: 0 0.6rem;
  font-size: 0.88rem;
  white-space: nowrap;
  font-family: 'Consolas', 'Courier New', monospace;
}

.input-group .btn {
  border-radius: 0;
  white-space: nowrap;
  border-left: 1.5px solid var(--border);
  align-self: stretch;
  padding-left: 1rem;
  padding-right: 1rem;
}

.check-result {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  min-height: 1.4rem;
}

.check-result.available {
  color: var(--success);
}

.check-result.unavailable {
  color: var(--error);
}

/* ====================================
   Features
   ==================================== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.feature-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ====================================
   Page Header
   ==================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* ====================================
   Records List
   ==================================== */
.records-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.record-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.record-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.record-info {
  flex: 1;
  min-width: 0;
}

.record-domain {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Consolas', 'Courier New', monospace;
  margin-bottom: 0.3rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  align-items: center;
}

.record-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.badge-a    { background: #dbeafe; color: #1d4ed8; }
.badge-aaaa { background: #fce7f3; color: #be185d; }
.badge-cname{ background: #d1fae5; color: #065f46; }
.badge-proxied { background: #fef3c7; color: #92400e; }

.record-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-state p:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* ====================================
   Content Pages (contact, Q&A, etc.)
   ==================================== */
.content-page {
  max-width: 740px;
  margin: 0 auto;
  padding-top: 1rem;
}

.content-page h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.content-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.info-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.info-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.info-section p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.info-card {
  background: var(--primary-light);
  border: 1px solid #cce0f5;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.info-card p {
  font-size: 0.95rem;
  color: var(--text);
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.faq-item h3 {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.faq-item p {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.6;
}

/* ====================================
   Admin
   ==================================== */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.data-table th {
  background: #f8f9fa;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8f9fa;
}

/* ====================================
   Modals
   ==================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
  border-radius: var(--radius);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text);
  background: var(--bg-body);
}

/* ====================================
   Forms
   ==================================== */
.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(33,133,208,0.12);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}

.form-group small {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.form-group .input-group input {
  width: auto;
  border: none;
  background: transparent;
  box-shadow: none;
}

.form-group .input-group input:focus {
  box-shadow: none;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  min-height: 1.3rem;
  margin-bottom: 0.5rem;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 400 !important;
  font-size: 0.92rem;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.agreement-group {
  margin-bottom: 0.5rem;
}

.agreement-group a {
  text-decoration: underline;
  font-weight: 500;
}

.agreement-group a:hover {
  color: var(--primary-hover);
}

/* ====================================
   Toast Notifications
   ==================================== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + 0.75rem);
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.toast-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.toast-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.toast-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ====================================
   Footer
   ==================================== */
.footer {
  text-align: center;
  padding: 1.75rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
}

.footer-link {
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color var(--transition);
}

.footer-link:hover {
  color: var(--primary);
}

.footer-sep {
  color: var(--text-dim);
  font-size: 0.82rem;
}

.footer-copy {
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* ====================================
   Responsive ??Mobile First
   ==================================== */

/* Tablet and down */
@media (max-width: 768px) {
  .navbar {
    /* full-width fixed bar stays single-row */
    overflow: visible;
  }

  .nav-inner {
    width: 100%;
    margin: 0;
    padding: 0 1rem;
    height: var(--nav-height);
    align-items: center;
  }

  .nav-brand {
    padding-right: 0;
    flex: 1;
    min-width: 0;
  }

  .nav-brand .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-toggle {
    display: flex;
  }

  /* Dropdown panel — absolutely positioned BELOW the navbar */
  .nav-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    width: 100%;
    flex-direction: column;
    background: #1a6eaf; /* slightly darker than #2185d0 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    padding: 0.5rem 0 0.75rem;
    z-index: 100;
    animation: dropdownIn 0.2s ease;
  }

  @keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }

  .nav-link {
    height: auto;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .nav-actions {
    margin-left: 0;
    flex-direction: row; /* 保持跟按鈕在同一橫排 */
    flex-wrap: nowrap;   /* 禁止換行 */
    align-items: center;
    padding: 0.75rem 1.25rem;
    gap: 0.75rem;
  }

  #user-greeting {
    max-width: none;
    width: auto;         /* 改為自動寬度，不要強制推滿 100% 導致其它元素換行 */
    padding: 0;
    font-size: 0.82rem;
  }

  /* Hero */
  .hero {
    padding: 2.5rem 0.5rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .preview-text {
    font-size: 1.05rem;
    padding: 0.6rem 1rem;
  }

  /* Check domain - two rows on mobile:
     Row 1: input + suffix  |  Row 2: button */
  .input-group {
    flex-wrap: wrap;
    border-radius: var(--radius);
  }

  .input-group input {
    flex: 1;
    min-width: 0;
  }

  .input-group .btn {
    flex-basis: 100%;
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
    border-left: none;
    border-top: 1px solid rgba(33,133,208,0.2);
    padding: 0.75rem;
  }

  /* Records */
  .record-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .record-domain {
    white-space: normal;
    word-break: break-all;
  }

  .record-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  /* Page header */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Content pages */
  .content-page h2 {
    font-size: 1.4rem;
  }

  /* Container */
  .container {
    padding: 1.5rem 1rem 3rem;
  }

  /* Modal */
  .modal-content {
    padding: 1.25rem;
  }

  /* Toast */
  .toast-container {
    left: 1rem;
    right: 1rem;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .hero h1 {
    font-size: 1.45rem;
  }

  .features {
    grid-template-columns: 1fr;
  }
}

/* ====================================
   Dashboard v2 — Tables & Components
   ==================================== */

/* Table wrap — replaces .table-container to not conflict */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-top: 1rem;
}

/* Usage counter badge */
.usage-badge {
  display: inline-block;
  margin-left: .6rem;
  padding: .2rem .65rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  vertical-align: middle;
}

/* "X 筆" badge in subdomains table */
.badge-count {
  display: inline-block;
  padding: .15rem .55rem;
  background: #f1f5f9;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: .8rem;
  font-weight: 600;
}

/* Record type badge (A / AAAA / CNAME) */
.record-type-badge {
  display: inline-block;
  padding: .15rem .55rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Reuse existing colour tokens */
.badge-a     { background: #dbeafe; color: #1d4ed8; }
.badge-aaaa  { background: #fce7f3; color: #be185d; }
.badge-cname { background: #d1fae5; color: #065f46; }

/* Actions cell in table */
.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: .4rem;
  align-items: center;
}

/* Content cell — prevent overly long IPs from breaking layout */
.content-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
  font-size: .82rem;
}

/* Empty row inside table */
.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 1rem;
  font-size: .9rem;
}

/* Required field asterisk */
.required {
  color: var(--error);
  margin-left: .15rem;
}

/* Small modal for confirmations */
.modal-sm { max-width: 400px; }

/* Textarea in profile modal */
#profile-purpose {
  width: 100%;
  font-family: inherit;
  font-size: .9rem;
  padding: .55rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition);
}
#profile-purpose:focus {
  outline: none;
  border-color: var(--primary);
}

/* DNS view title inline with back button */
#dns-view-title {
  font-size: 1.15rem;
  font-weight: 700;
  vertical-align: middle;
}

code {
  background: #f1f5f9;
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .82em;
  color: #374151;
}

/* Responsive: stack actions on small screens */
@media (max-width: 600px) {
  .actions-cell {
    flex-direction: column;
    gap: .25rem;
  }
  .content-cell { max-width: 120px; }
}
